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 currently evaluating Essential Grid (and am very impressed! Looks like we'll replace our existing grid control)
I'm having trouble getting merged column headers to work. Have been using the following code:
'merge and centre the column headers With Me.GridControl1 .Model.Options.MergeCellsMode = GridMergeCellsMode.MergeColumnsInRow
'specify no merging for Standard style .BaseStylesMap("Standard").StyleInfo.MergeCell = GridMergeCellDirection.None
'specify merging for Column Headers style .BaseStylesMap("Col Header").StyleInfo.MergeCell = GridMergeCellDirection.ColumnsInRow
End With
'After this, I load data from a DataTable using PopulateValues (this works fine with merging turned off)
However the merging code must fail somewhere because when it later gets to: Me.GridControl1.ColWidths.ResizeToFit(GridRangeInfo.Cols(0, Me.GridControl1.ColCount - 1))
...I get a NullReferenceException. Not sure what exactly is raising that though! The grid shows no rows or columns after this.
HAhaneefm Syncfusion Team May 31, 2007 06:25 PM UTC
Hi Richard,
You can try enabling the GridMergeCellsMode.OnDemandCalculation flag in a MergeCellsMode property. Please try the suggestion and let me know if this helps.
Me.GridControl1.Model.Options.MergeCellsMode = Syncfusion.Windows.Forms.Grid.GridMergeCellsMode.OnDemandCalculation Or Syncfusion.Windows.Forms.Grid.GridMergeCellsMode.MergeColumnsInRow
Best regards, Haneef
RBRichard BysouthJune 4, 2007 11:30 PM UTC
Haneef
Thanks very much - that works perfectly!
I noticed there was also a typo in my code - the style name should have been "Column Header", not "Col Header".