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.
1) I m having a tree view and a datagrid. My task is to fill datagrid as per the item selected in tree view.
2)After assinging datasource to datgrid, I am setting width of columns as per table fetched from dataset.
3) It works perfect with very first table, but when the dataset again gets filled with another table having different numbers of columns it gives error "System.ArgumentOutOfRangeException at "Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor.get_Item(Int32 index)""
4)If all the tables fetched by dataset contain same number of columns, it display tables in grid, with first column values are proper and rest of the column are empty…
Code Snippet
''''''''Get Table as Per Selected Tree Node
Mydataset = MyClass.GetDataSetFromStoredProcedure(MyCommandString)
Mydatagrid.DataSource = Mydataset.Tables(0).DefaultView
''''''''Set The width of the Columns per Datagrid Width
For intColumns = 0 To Mydataset.Tables(0).Columns.Count - 1
''''''''Giving Error On this Line
Mydatagrid.TableDescriptor.Columns(intColumns).Width = Mydatagrid.Width / Mydataset.Tables(0).Columns.Count
Next intColumns
ADAdministrator Syncfusion Team April 17, 2006 10:42 AM UTC
Hi Rahul,
This exception occurs because the TableDescriptor elements are not reset properly. This can be avoided by calling the TableDescriptor.ResetTableDescriptor().
Thanks for being patient.
Best regards,
Madhan