BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
GridBoundRecordState rs = grid.Binder.Binder.GetRecordStateAtRowIndex(e.Index);
Then you can set e.Size base on rs.LevelIndex and set e.Handled = true. This woul dlet you size the parent row one way an dteh child row another. But, if you want to allow your user to size things, these actions will be in conflcit with automatically sizing things in QueryRowHieght. To handle this, youwoul dhave to maintain a list of explicitly set rowheights and use that list to set the rowheight in QueryRowHeight if one of the expleictly set rows is being requested. This would take a little work.
>Is there a way to tell whether any of the "child" records are being displayed or if all of them are collapsed?
>
There is a grid.IsExpandedAtRowIndex method that you can used to test if a row is expanded.
>Is there an event that corresponds to when the user expands or collapses a node?
>
There are grid.RowExpanding/RowExpanded and grid.RowCollapsing/RowCollapsed events.
>Are the "child" records always present in the grid''s row collection? For example, RowIndex = 2 would be my first child record if it''s parent is expanded - will RowIndex = 2 ALWAYS be the first child record regardless?
>
The child rows are only in the grid when their parent row is expanded. They are not always present.
>GridBoundRecordState rs = grid.Binder.Binder.GetRecordStateAtRowIndex(e.Index);
>
>Then you can set e.Size base on rs.LevelIndex and set e.Handled = true. This woul dlet you size the parent row one way an dteh child row another. But, if you want to allow your user to size things, these actions will be in conflcit with automatically sizing things in QueryRowHieght.
Is QueryRowHeight all or nothing? If I use the following code to try to resize just the child rows ...
GridBoundRecordState rs = this.gridEvents.Binder.GetRecordStateAtRowIndex(e.Index);
if (rs != null && rs.LevelIndex != 0)
{
e.Size = 17;
e.Handled = true;
}
I''m unable to resize any of the rows. I also seem to be unable to invoke this method in the base class.
this.gridDataBoundGrid1.AllowResizeToFit = false;
this.gridDataBoundGrid1.Model.ColWidths[1] = 15;
Does this not work for you?
this.gridDataBoundGrid1.AllowResizeToFit = false;
this.gridDataBoundGrid1.Model.ColWidths[0] = 17;
this.gridDataBoundGrid1.Model.ColWidths[1] = 17;
I suspect in your code, there is something (maybe a grid.Model.Colwidths.ResizeToFit call or some code in a QueryColWidths handler) that is changing the widths after you have set them. One way to try to spot this is to add a this.gridDataBoundGrid1.Model.ColWidthsChanging event handler and see if/where column 0 is being set to size 12.
If you can post a sample project showing the problem (maybe modify the above sample to show it), we can try to spot something here.