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)For same tables with same no. of column as per first, columns are coming as per width but empty
Code Snippet
''''Get Table as Per Selected Tree Node
dsLoadAssetToGrid = clsSqlDatabase.GetDataSetFromStoredProcedure(cmdLoadAssetToGrid)
dgAssetLocator.DataSource = dsLoadAssetToGrid.Tables(0).DefaultView
''''Set The width of the Columns per Datagrid Width
For intColumns = 0 To dsLoadAssetToGrid.Tables(0).Columns.Count - 1
''''Giving Error On this Line dgAssetLocator.TableDescriptor.Columns(intColumns).Width = dgAssetLocator.Width / dsLoadAssetToGrid.Tables(0).Columns.Count
Next