I''m working on a grid based off the ExpandGrid example. I have two levels, a master and a detail, related by
hlBatch_Item = gridBinder.AddRelation("BatchItem");
I''ve added a context menu to the grid, which should behave differently if the user is clicking on an Item row or on a Batch row.
- How can I find out in which one I am?
- From a group of expanded Item rows, how can I obtain their corresponding Batch row?
Thanks in advance,
ADAdministrator Syncfusion Team June 2, 2004 04:06 AM
Given a particular grid rowIndex, you can use
GridBoundRecordState rs = this.grid.Binder.GetRecordStateFromRowIndex(rowIndex);
This GridBoundRecordState holds the information you requested, rs.LevelIndex and rs.Position.
To get the rowIndex under the current mouse location, you can use code like;
int row, col;
Point pt = this.grid.PointToClient(Control.MousePosition);
this.grid.PointToRowCol(pt, out row, out col, -1);