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''d like to resize the rowheader column of a GridDataBoundGrid control but find that using grid.Model.ColWidths[0] = 20 resizes all columns (including the rowheader) to the same width.
How can I resize just the rowheader column?
TIA
ADAdministrator Syncfusion Team August 11, 2005 08:27 AM UTC
I think your code is the way to do this. But if you want to do this when the grid is not visible (like in Form.Load), then you also have to set:
this.gridDataBoundGrid1.AllowResizeToFit = false;
But turning AllowResizeToFit to false, will prevent the other columns to be sized to fit by default. If you want this to happen, then you would also add a call to ResizeToFit.
this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit(GridRangeInfo.Cols(1, this.gridDataBoundGrid1.Model.ColCount), GridResizeToFitOptions.IncludeHeaders);
Here is a little sample showing this working.
http://www.syncfusion.com/Support/user/uploads/GDBG_SizeRowHeader_460c5d41.zip
ADAdministrator Syncfusion Team August 12, 2005 02:45 AM UTC
Thanks for your prompt reply Clay however your suggestion only seems to work when the GridDataBoundGrid control is placed on the form in the designer.
I still get the same strange behaviour when instantiating and placing the control on the page entirely through code.
Any other ideas?
ADAdministrator Syncfusion Team August 12, 2005 07:16 AM UTC
I think the same sort of code should work at runtime. Here is the sample with the grid being created and displayed in a button handler.
http://www.syncfusion.com/Support/user/uploads/GDBG_SizeRowHeader_4591632b.zip
Can you modify this sample to show the problem you are having?