2011-07-12 41 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