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.
Syncfusion Feedback

GridDataBoundGrid: Addressing rows by table level and record position within table

Thread ID:

Created:

Updated:

Platform:

Replies:

59064 Apr 4,2007 11:27 AM UTC Apr 4,2007 01:00 PM UTC Windows Forms 1
loading
Tags: GridControl
Helen Kosova
Asked On April 4, 2007 11:27 AM UTC

Hello,

I have the following question concerning the GridDataBoundGrid control (v.4.4.0.51):

How can I refer to a grid row that contains a specific record, based on the level of the table that contains this record and the position of this record in the table?
For example, in the "ExportGrid" sample, if I expand the 2nd row ("CategoryName = Condiments") in the topmost table and then the 5th row ("ProductName = Northwoods Cranberry Sauce") in the nested table, how can I programmaticaly determine the grid-relative row index of the 6th record ("OrderID = 10709") in the OrderDetails table?

So far, I can only guess that this can be done by iterating through the grid rows and checking the displayed text, or something like that. I am just wondering if there is a simpler way to do that. Any help will be greatly appreciated.

Thanks,
Helen

Helen
Replied On April 4, 2007 01:00 PM UTC

I've found a simple solution, but it assumes that all records in the table above the desired record are collapsed:

int GetChildRowIndex (GridDataBoundGrid grid, int ParentRowIndex, int Level, int RecordIndex) {
return ParentRowIndex + grid.Binder.GetHierarchyLevel(Level).RowCountPerRecord*(RecordIndex + 1);
}

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

;