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.
If this is a data bound grid try:
grid.Model.Cols.Size[col] = 200;
> How do I explicitly set the column width for a grid with mulitple column rows.
>
> If I use the grid.Model.ColWidths it does not change.
>
> Tx,
> curt
ADAdministrator Syncfusion Team February 7, 2003 05:51 PM UTC
grid.Model.ColWidths should work. You just have to be aware that the row header in the second and third rows are sharing the same columns as the first row.
Also, getting the column index that is associated with a field number within the table is a bit more complicate. The column index that is associated with a that fieldNum needs to be determined with code as follows
GridBoundRecordState state = Binder.GetRecordStateAtRowIndex(rowIndex);
GridHierarchyLevel ghl = Binder.levels[state.level] as GridHierarchyLevel;
int rowFieldNum = ghl.RowFieldToField(state.row, fieldNum);
int colIndex = this.binder.FieldToColIndex(rowFieldNum);
Now you can change the column width for the specified field.
We will try to make such things easier in future versions ...
Stefan