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

GGC Adding/Removing datasource columns

HI, I am using the GridGroupingControl and I have a basic 2 level hierarchy. I have a checkbox column in both the parent and child dataview. I am using the grid''s dataview manager to get the view and then removing the checked column in the parent dataview. Then I am adding back in this column and changing it value. It is faster than looping through the view and changing all the values. I have 2 problems. 1. When I remove the Checked Column and add it back, I can''t change the checkbox state. It is like it is locked on disabled. Here''s the code I am using to remove the checked column from the dataview GridGroupingControl1.BeginUpdate() Dim MyGridDV As DataView Dim DV As New DataView Dim MyDS As New DataSet MyGridDV = GridGroupingControl1.DataSource MyDS = MyGridDV.DataViewManager.DataSet Dim i As Integer DV = MyDS.Tables(0).DefaultView Try DV.Table.Columns.Remove("Checked") DV.Table.Columns.Add("Checked", System.Type.GetType("System.Boolean"), "DIGITAL_DATA_EXIST = 1") Catch ex As Exception End Try GridGroupingControl1.DataSource = MyGridDV GridGroupingControl1.EndUpdate(True) 2. When I add/remove the columns the grid closes any open grids. Ie if a parent is expanded and I add/remove columns the parent closes. Any help would be great.

1 Reply

AD Administrator Syncfusion Team March 28, 2006 07:04 AM UTC

Hi Chris, 1) Setting the Expression property of a DataColumn to anything other than an empty string automatically sets the ReadOnly property of the column to true and it can not be changed. If you are trying to set the value depending upon other column value in the row then please refer this KB article to see if that helps. 2) Adding/ removing columns don’t seem collapsing any expanded parent/child table in the grid, in version 4.1.0.62. Let me know if you have any further queries. Regards, Calvin.

Loader.
Live Chat Icon For mobile
Up arrow icon