We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem with GridDataBoundGrid

Hi, This is very weird Problem. I wrote one simple program to test it Here are steps to test it: 1) Click on the First row of the DataGrid. 2) Tab through the field until “Trx Number” column disappear. (Tab should be Stop at “Broker” column) 3) Now Click Left arrow on the Scroll Bar, I could not found “Trx Number” anymore. I think this is because I hide “Symbol” Column in my form load. If I show all the columns, everything is fine. Thanks a lot. --Shuyang he grid_3831.zip

3 Replies

AD Administrator Syncfusion Team June 30, 2005 12:05 AM UTC

If you want to hide a column, do not add a GridBoundColumn for it instead of trying to set grid.Model.Cols.Hidden.
For count As Integer = 0 To Me.all_Columns.Length - 1
            If all_Columns(count) <> "Symbol" Then
                Dim aGridColumn As Syncfusion.Windows.Forms.Grid.GridBoundColumn
                aGridColumn = New Syncfusion.Windows.Forms.Grid.GridBoundColumn
                aGridColumn.MappingName = all_Columns(count)
                Me.GridDataBoundGrid1.GridBoundColumns.Add(aGridColumn)
            End If
        Next


SH Shuyang He June 30, 2005 01:18 PM UTC

Hi, Thanks for your help. But my project need show and hide columns frequently based on different selections. It is not very good approach to recreate GidColumns every time I simply want to hide or show columns. By the way, I do think this is bug in the GridDataBoundGrid. Is that possible it can be fixed next release? Thanks. --Shuyang he >If you want to hide a column, do not add a GridBoundColumn for it instead of trying to set grid.Model.Cols.Hidden. > >
>For count As Integer = 0 To Me.all_Columns.Length - 1
>            If all_Columns(count) <> "Symbol" Then
>                Dim aGridColumn As Syncfusion.Windows.Forms.Grid.GridBoundColumn
>                aGridColumn = New Syncfusion.Windows.Forms.Grid.GridBoundColumn
>                aGridColumn.MappingName = all_Columns(count)
>                Me.GridDataBoundGrid1.GridBoundColumns.Add(aGridColumn)
>            End If
>        Next
>
>


AD Administrator Syncfusion Team June 30, 2005 01:51 PM UTC

If you do not want to control the displayed columns using the GridBoundColumnCollection, then setting these two properties will hide the colde and avoid teh scrolling problem. Me.GridDataBoundGrid1.Model.Cols.Hidden("Symbol") = True Me.GridDataBoundGrid1.Model.ColWidths("Symbol") = 0

Loader.
Live Chat Icon For mobile
Up arrow icon