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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hierarchy Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

12909 Apr 14,2004 08:26 PM UTC Apr 20,2004 05:36 PM UTC WinForms 4
loading
Tags: GridControl
Ben
Asked On April 14, 2004 08:26 PM UTC

I''m using a Grid data bound grid and gridhierarchylevel for displaying a Master-Detail. I want to access the row index of the current/selected row in the detail table. What method or properties should I be using to do this. I tried to use CurrencyManager but the datasource for the Grid is the Master table. I''ve looked at the sample for GridHierarchyLevel and didn''t see any clues. I''m using 1.6.1.8 Thanks Ben

Administrator [Syncfusion]
Replied On April 14, 2004 08:39 PM UTC

You can get the GridBoundRecordState for the row. int rowIndex = grid.CurrentCell.RowIndex; GridBoundRecordState rs = grid.Binder.GetRecordStateAtRowIndex(rowIndex); rs.Position will have the position of this record in its table.

Ben
Replied On April 20, 2004 01:54 PM UTC

> rs.Position will have the position of this record in its table. I don''t believe that is correct, it was not my experience in practice unless I misunderstood or had a different expectation. rs.Position returns the position value for the record relative to it''s siblings, and is zero based. So it might be position 0, the first child of the parent even though there are other parents with children. To obtain the current record use rs.ListManager.Current. On another note, I have realized I was mistaken in my assumption of how GridHierarchyLevel behaved. If I''m in a GridDataBoundGrid with Master-Detail implemented how can I determine if the current row is a Master or Detail row. Thanks for the support. Ben Andrews

Administrator [Syncfusion]
Replied On April 20, 2004 05:12 PM UTC

I am not sure what you mean by a Master-Details in a GridDataBoundGrid. Are you adding a parent-child relation to the dataset, and showing this in a hierarchical grid? If so, try int rowIndex = grid.CurrentCell.RowIndex; GridBoundRecordState rs = grid.Binder.GetRecordStateAtRowIndex(rowIndex); rs.LevelIndex will have the hierarchy level of the row.

Ben
Replied On April 20, 2004 05:36 PM UTC

Clay, Sorry about the confusion, yes I''m using Master-Detail as parent-child relation to a dataset. >I am not sure what you mean by a Master-Details in a GridDataBoundGrid. Are you adding a parent-child relation to the dataset, and showing this in a hierarchical grid? > Ok, thanks this works. I thought I accessed the hierarchy level from the GridHierarchyLevel but need to use GridBoundRecordState. The documentation in 1.6.1.8 for GridBoundRecordState isn''t very complete, just hoping that it may have been improved for 2.0 >If so, try > >int rowIndex = grid.CurrentCell.RowIndex; >GridBoundRecordState rs = grid.Binder.GetRecordStateAtRowIndex(rowIndex); > > >rs.LevelIndex will have the hierarchy level of the row.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;