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 use like this :
this.grdDateNames.AllowResizeToFit =false;
this.grdDateNames.Model.ColWidths[0] = 250;//this.grdDateNames.Width;
grdDateNames.DataSource = dateNameVO.DateNameTable;
this.grdDateNames.Model.ColStyles["name"].DropDownStyle
= GridDropDownStyle.Editable;
GridBoundColumn gbcDateName;
gbcDateName = this.grdDateNames.Binder.InternalColumns[DateNameVO.colName];
gbcDateName.StyleInfo.CellValueType = typeof(string);
gbcDateName.StyleInfo.BorderMargins.Left =60;
gbcDateName.StyleInfo.HorizontalAlignment = GridHorizontalAlignment.Left;
But it neither resizes the column nor shows the data.
Please show me how to solve this problem.
ADAdministrator Syncfusion Team January 25, 2005 07:40 AM UTC
>>this.grdDateNames.Model.ColWidths[0]
0 is the row header column. Is that the column whose width you are trying to set? Try setting the width on col 1 to see if that has an effect.
>>this.grdDateNames.Model.ColStyles["name"].DropDownStyle
In a GridDataBoundGrid, you use the GridBoundColumn.StyleInfo to set column styles, not the ColStyles collection. So, try setting these styles on the GridBoundColumn. You access teh GridBoundColumns through the grid.Binder.InternalColumns collection only if you have not explicitly added GridBoundColumns to the grid.GridBoundColumns collection either through the designer or through code.