We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Finding out what level the grid is in - based on ExpandGrid example

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, Ricardo

2 Replies

AD Administrator Syncfusion Team June 2, 2004 08:06 AM UTC

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);

RJ Ricardo J. Méndez June 22, 2004 09:48 PM UTC


Live Chat Icon For mobile
Up arrow icon