2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
You can use the GridHierarchyLevel.LayoutColumns method to hide the MainTable/ChildTables columns in a grid. LayoutColumns method rearranges how the columns are displayed in the grid and allows you to specify the covered cells and /or break records into several rows displayed in the grid. Syntax: void GridHierarchyLevel.LayoutColumns(String[] mappingNames) mappingNames: A string array with field names. The following string have a specific meaning
C# void setHiddenCols(GridHierarchyLevel level, int hiddenIndex) { int Colcount = level.InternalColumns.Count; int hiddenCount = 0; string[] layout = new string[ Colcount -1 ]; for( int i = 0 ; i< Colcount;i++) { if(i != hiddenIndex - 1) layout[hiddenCount + i] = level.InternalColumns[i].MappingName; else hiddenCount = -1; } level.LayoutColumns(layout); } VB Private Sub setHiddenCols(ByVal level As GridHierarchyLevel, ByVal hiddenIndex As Integer) Dim Colcount As Integer = level.InternalColumns.Count Dim hiddenCount As Integer = 0 Dim layout() As String = New String( Colcount -1 ) {} Dim i As Integer For i = 0 To Colcount- 1 Step i + 1 If i <> hiddenIndex - 1 Then layout(hiddenCount + i) = level.InternalColumns(i).MappingName Else hiddenCount = -1 End If Next level.LayoutColumns(layout) End Sub Sample: http://websamples.syncfusion.com/samples/kb/Grid.Windows/Grid_WF_GDBGHideColumns/main.htm |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.