Could you please show me how to add a button to a lower level (unbound) in a DBG/hier.? The example does it to a first level, which works OK, but I can not untie the calls to get it into lower levels, unbound, added column. Thank you.
ADAdministrator Syncfusion Team August 4, 2004 09:01 AM
In your QueryCellInfo where you are providing the value for the unbound column, instead of just checking e.ColIndex, use code like this to get the GridBoundRecordState for the given row.
GridBoundRecordState rs = this.grid.Binder.GetRecordStateAtRowIndex(e.RowIndex);
Once you have this object, you can check rs.LevelIndex to see what hierarchy level you are on, and then you can set the properties in e.Style accordingly for a particular level.
EAEarlAugust 4, 2004 09:16 AM
I''m using your 3967-1 example code & ExpandGrid.
Does "gridDataBoundGrid1.Model.ColWidths[x]" act on the lower level items?
ADAdministrator Syncfusion Team August 4, 2004 10:19 AM
Yes, it should work unless there is something else preventing teh sizing from working. In a GridDataBoundGrid hierarchical grid, there really is only one grid, so properties like colwidth affect all levels.
One thing that might prevent this from working initially is if you do not set grid.AllowResizeToFit = false. If this is true, the grid tries to autosize things initially, and this can step only any explicit sizing you try to do.