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

GridDataBoundGrid Hide Columns

I have a GridDataBoundGrid that I’m binding to a DataView with 4 columns and n rows. I don’t want to display the first column as it is simply a unique identifier column that the end user doesn’t need to see. How do exclude that column from binding?

2 Replies

TT Tito Toro January 11, 2005 05:31 PM UTC

I found that this works: int i = 1; Grid2.Model.Cols.Hidden[i] = true; >I have a GridDataBoundGrid that I’m binding to a DataView with 4 columns and n rows. I don’t want to display the first column as it is simply a unique identifier column that the end user doesn’t need to see. How do exclude that column from binding? >


AD Administrator Syncfusion Team January 11, 2005 06:05 PM UTC

As Tito suggested, you can hide the columns so they do not show in your grid. Another option is to add GridBoundColumn objects for each column that you want to see to the grid.GridBoundColumns collections. //add col1 GridBoundColumn gbc = new GridBoundColumn(); gbc.MappingName = "Col1"; grid.GridBoundColumns.Add(gbc); //add col2 gbc = new GridBoundColumn(); gbc.MappingName = "Col2"; grid.GridBoundColumns.Add(gbc); //etc

Loader.
Live Chat Icon For mobile
Up arrow icon