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.
Hi,
I am using DataboundGrid. I added 10 columns using
m_ListingTable.Columns.Add(new DataColumn("1"));
I want to access same columns using GridBoundColumns How do i do that.
It threw exception when i used the below code
for (int start = 0; start < m_ListingTable.Columns.Count; start++)
{
GridBoundColumn column = new GridBoundColumn();
column.MappingName = m_ListingTable.Columns[0].ColumnName.ToString();
column.HeaderText = m_ListingTable.Columns[0].ColumnName.ToString();
if (!m_ListingGrid.GridBoundColumns.Contains(column))
{
m_ListingGrid.GridBoundColumns.Add(column);
}
}
ADAdministrator Syncfusion Team April 21, 2005 12:32 PM UTC
Each of the DataColumns needs a different name, so you cannot create all ten using the name "1".
In your loop, try using start instead of 0.
column.MappingName = m_ListingTable.Columns[start].ColumnName.ToString();
column.HeaderText = m_ListingTable.Columns[start].ColumnName.ToString();