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 have an object which contains a list of children (of the same type). In the main class i have a list of objects of this type and I have binded this to a grid grouping control. I think the control understand the relation between these objects and automatically displays the children of the parent object in a hierarchical manner.
My question is how do i auto-adjust the width of all columns to fill the available space? I have got this working for the root level but i dont really know how to do that for the levels beyond that.
Actually I have sorted this out but i realized that the border between the parent cells and the nested cells is not exactly aligned. I want the parent cells with the children cells to be exactly the same in terms of positioning and width.
Thanks
HAhaneefm Syncfusion Team April 12, 2008 12:19 AM UTC
Hi John,
If you want to align the ParentTable and ChildTable properly, you need to use the TrackWidhtofParentColumn property. You can use the below code snippet to resolve this issue.
Works great but now the grid doesnt consume all the client area cause i had to remove the QueryColWidth handler to make the column alignment work. Is there any way to combine both? thx
HAhaneefm Syncfusion Team April 23, 2008 10:34 PM UTC
Hi JohnFish,
You can set the Colwidth of the last column by using the below code snippet to fill the client area. Below are the codes:
int width = this.gridGroupingControl1.TableModel.ColWidths.GetTotal(0, this.gridGroupingControl1.TableModel.ColCount - 2); int clientwidth = this.gridGroupingControl1.ClientRectangle.Width; this.gridGroupingControl1.TableDescriptor.Columns[ this.gridGroupingControl1.TableDescriptor.Columns.Count - 1].Widht = clientwidht - width;