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.
We use this.Model.ColWidths.ResizeToFit(GridRangeInfo.Rows(0, 100), GridResizeToFitOptions.IncludeHeaders) to set the column width automatically, however, we still need to add more space for the width of header cell.
It''s possible to get it by setting the border like: this.RowStyles[0].BorderMargins.Right = 20;this.RowStyles[0].BorderMargins.Left = 20;
Thanks.
ADAdministrator Syncfusion Team January 5, 2006 07:27 AM UTC
Hi Hui,
BorderMargins are for cell''s internal borders. If the border margin is set for an editable cell then effect can be seen in the current cell''s border.
this.gridDBG.Model.ColStyles[1].BorderMargins.Right = 20;
To size the column beyond its default width, then you may use ColWidths properties or handle in QueryColWidth handler, but to use Colwidths property, AllowResizeToFit has to be set to false.
private void Model_QueryColWidth(object sender, GridRowColSizeEventArgs e)
{
if(e.Index == this.grid.Binder.NameToColIndex("columnName"))
{
e.Size = 100;
e.Handled = true;
}
}
Also refer this KB: http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=304 to see if that helps.
Regards,
Calvin.