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
close icon

GridBoundColumns in DataBound Grid

Hello, i''m using GridDataBound i link a the grid with the dataTable as a datasource, then i create two GridBoundColumn which will be unbounds columns (one column contain buttons and the other comboBoxs) when I add them the grid by using GridBoundColumns.AddRange,the dataTable columns does not appear in the grid, when i comment the "GridBoundColumns.AddRange", i could display the the dataTable in the grid Thanks in advance

1 Reply

AD Administrator Syncfusion Team January 10, 2006 03:09 PM UTC

Hi, You can add unbound columns with the help of GridBoundColumnCollection. You can add the unbound columns one by one to the gridBoundColumnCollection or collectively using gridBoundColumnCollection.AddRange. Here is code snippet. GridBoundColumnsCollection column = (GridBoundColumnsCollection) this.gridDataBoundGrid.Binder.InternalColumns.Clone(); GridBoundColumn Ucolumn1 = new GridBoundColumn(); GridStyleInfo style1 = Ucolumn1.StyleInfo; style1.CellType ="PushButton"; //column.Add(Ucolumn1); //Add one by one GridBoundColumn Ucolumn2 = new GridBoundColumn(); GridStyleInfo style2 = Ucolumn1.StyleInfo; style2.CellType ="ComboBox"; //column.Add(Ucolumn2); //Add one by one column.AddRange(new GridBoundColumn[] {Ucolumn1,Ucolumn2}); //Add by AddRange Regards, Calvin.

Loader.
Live Chat Icon For mobile
Up arrow icon