开发者

Using DataRelations and DevExpress Grids - Hide expansion control

I have a bit of a weird issue. We use DevExpress controls to do all our Windows Form development. Anyway, I found a perfect use for the DataRow.SetParentRow/GetParentRow methods in my grid. So I created a DataRelation, added it to the DataSet and bound it as the data source for my grid. The issue is I now find this:

Using DataRelations and DevExpress Grids - Hide expansion control

On my grid. It seems to be the DataRelation (when I mouse over it the tooltip is the DataRelation name).

Does anyone know how to hide this line of controls? If I cannot get rid of them I will have to write a parent/child link betw开发者_高级运维een the rows, and that would be a shame because the DataRelation stuff works almost perfectly.

Thanks in advance!


You want to set the following property to hide those: (this is for a grid view, banded grid view or advanced banded grid view)

In OptionsDetail set EnableMasterViewMode=False

If you have a master Detail grid that has times where the details are empty and you want to hide those you can do so by handling the custom draw for the masterview cells something like this:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜