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.
Unfortunately, activation email could not send to your email. Please try again.

Hierarchical Grid Row to DataTable Row Mapping

Thread ID:

Created:

Updated:

Platform:

Replies:

8716 Nov 17,2003 05:37 PM Nov 19,2003 01:57 PM Windows Forms 4
loading
Tags: GridControl
Adi
Asked On November 17, 2003 05:37 PM

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 12:36 AM

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.

Adi
Replied On November 19, 2003 11:43 AM

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 12:54 PM

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.

Adi
Replied On November 19, 2003 01:57 PM

That is what I thought. Thanks Clay.

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.

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.

;