2011-07-12 39 views
1

我有点奇怪的问题。我们使用DevExpress控件来完成我们所有的Windows窗体开发。无论如何,我在我的网格中找到了DataRow.SetParentRow/GetParentRow方法的完美用法。所以我创建了一个DataRelation,将它添加到DataSet并将其绑定为我的网格的数据源。这个问题是我现在发现这样的:使用DataRelations和DevExpress网格 - 隐藏扩展控件

enter image description here

在我的网格。它似乎是DataRelation(当我将鼠标移到它上面时,工具提示是DataRelation名称)。

有谁知道如何隐藏这条线的控制?如果我无法摆脱它们,我将不得不在行之间编写父/子链接,这将是一个耻辱,因为DataRelation的东西几乎完美。

在此先感谢!

回答

3

你想设置以下属性来隐藏这些:(这是一个网格视图,带状网格视图或高级带状网格视图)

在OptionsDetail设置EnableMasterViewMode =假

如果你有一个主详细信息网格,有次,其中的细节是空的,你要隐藏这些可以通过处理自定义这样做得出的马西德威细胞是这样的:

Private Sub gvMain_CustomDrawCell(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles gvMain.CustomDrawCell 
    Dim View As DevExpress.XtraGrid.Views.Grid.GridView = CType(sender, DevExpress.XtraGrid.Views.Grid.GridView) 
    If e.Column.VisibleIndex = 0 And View.IsMasterRowEmpty(e.RowHandle) Then 
     CType(e.Cell, DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo).CellButtonRect = Rectangle.Empty 
    End If 
End Sub 
+0

我抬起头来的DevExpress DOCO,你是非常正确。谢谢。 – hsimah