The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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?
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?
>
ADAdministrator 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