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''m using DBDG. when I load a table, the column names get spanned on two lines as the space is not sufficient to show the column name in one line. Can some one tell how to dynamically change the width of column to match with the length of the text held by that cell.
ADAdministrator Syncfusion Team August 10, 2006 09:33 AM UTC
Hi Suhas,
Please set the AllowResizeToFit property of the databoundgrid to true in the form_Load, this will help you to display the entire name in single line. This property is true by default.
this.gridDataBoundGrid1.AllowResizeToFit = true;
You can call the ResizeToFit method to dynamically make the contents of the cell to fit inside. this.gridDataBoundGrid1.Model.ColWidths.ResizeToFit( GridRangeInfo.Col(2) ); // resizes column 2
FYI, you can also set the column widths manually for any particular column,like in the code below, this.gridDataBoundGrid1.Model.ColWidths[2] = 75; // setting the column width for column2