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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hierarchical Grid Row to DataTable Row Mapping

Thread ID:





8716 Nov 17,2003 10:37 PM UTC Nov 19,2003 06:57 PM UTC WinForms 4
Tags: GridControl
Asked On November 17, 2003 10:37 PM UTC

I have a grid with three levels of hierarchy based on three datatables in a single dataset. In order to handle one of the grid events I am trying to determine which row in a datatable grid row maps to by using Binder.RowIndexToListManagerPosition which works great for the root level but does not work/exist for other levels. Any ideas on how to determine datatable row position for the second and third level? Thanks, Adi

Administrator [Syncfusion]
Replied On November 18, 2003 05:36 AM UTC

It is not easy to get the actual row position in the orginal table, but you can get the actual row object in the datatable with code like: GridBoundRecordState rs = this.gridDataBoundGrid1.Binder.GetRecordStateAtRowIndex(gridRowIndex); int pos = rs.Position; CurrencyManager cm = (CurrencyManager) rs.ListManager; DataRow dr = ((DataRowView)cm.List[pos]).Row; Hopefully, you only need the actual object to do your work, and not its positin in the original table. If you need the to know the index in the original table, you would have to loop through the tables.Rows looking for the above dr. Using our GridGroupingControl (available in teh upcoming 2.0 release), you will be able to map any row back to the original position.

Replied On November 19, 2003 04:43 PM UTC

Thanks Clay, this helps. I have another follow-up question: my hierarchical grid has three levels. The far right column in each level is a checkbox control. Do you know if there is an easy way to show using tristate (grey checkbox) if one of the child records has been checked but also not allow user to select indeterminate checkbox state? I know this might be hard to imagine so please do let me know if I can clarify. Thanks

Administrator [Syncfusion]
Replied On November 19, 2003 05:54 PM UTC

If I am understanding what you want, I think it would be difficult. The main reason is that there is no simple way to get at child records unless the node is opened. So, if you want you parent checkbox to reflect the state of its child record when the node is closed, then you would have to go to some trouble to do it, getting everything from the ADO.NET structures (without using any grid information to do so). This will be simpler to do in the upcoming 2.0 release with its grouping support.

Replied On November 19, 2003 06:57 PM UTC

That is what I thought. Thanks Clay.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon