Posted 30 April 2019, 12:25 am EST
Is there a way to set the column widths for non-top level rows in a hierarchical spread?
Forums Home / Spread / Spread for WinForms
Posted by: bbordiuk on 30 April 2019, 12:25 am EST
Posted 30 April 2019, 12:25 am EST
Is there a way to set the column widths for non-top level rows in a hierarchical spread?
Posted 30 April 2019, 12:26 am EST
NM. I got it, I think.
Posted 30 April 2019, 3:45 pm EST
Hello,
Glad that you could find a solution for yourself.
However, to make it helpful for other community members, I would request you to share your findings here.
Meanwhile as I understand, you wanted to customize the column widths for the child SheetView of a row. If that’s the case, one solution is to handle the ChildViewCreated event and inside set its column’s Width, as follows:
private void Spread_ChildViewCreated(object sender, ChildViewCreatedEventArgs e)
{
var childSheet = e.SheetView;
if (childSheet.ParentRelationName == "Orders")
{
for (int i = 0; i < childSheet.Columns.Count; i++)
childSheet.Columns[i].Width = 120;
}
}
```If you used any other approach, please do share it here.
Thanks,
Ruchir