Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
DuplicateRow(): targeting rows in child grids
posted

All,

I'm somewhat new to Infragistics so please pardon me if my terminology is incorrect.

I have a view that holds 2 panes, say a "car" and a "car_details" grid, supporting a one-to-many relationship.

I want to duplicate the select car, with a cascade effect of also duplicating the car_details.
This works:
 UltraGridRow newCar = _view.ViewGrids["car"].DuplicateRow();

Now I have a duplicated car, and in the car_detail grid, a set of duplicated car_detail rows.
I want to modify them.

I might normally do something like this:
 foreach (UltraGridRow carDetail in this._view.ViewGrids["car_detail"].Rows)

But it picks up EVERYTHING in the 2nd grid - including the original details.
I want to target only those rows that are tied to the duplicated car.

I am looking for something like:
 foreach (UltraGridRow carDetail in newCar["car_detail"].Rows)

This is of course because "newCar" already has a reference to the duplicated object.

Thank you kindly for reading my post and I'll certainly appreciate any feedback received! :)

Parents
  • 23930
    Offline posted

    Hi Bill,

    Thank you for contacting Infragistics Developer Support.

    UltraGrid doesn’t have a method called DuplicateRow or ViewGrids property (neither does the UltraGridRow or UltraGridBand). So you must have extended the UltraGrid functionality in some way.

    Anyway if you have a grid row and you want to access all its child rows, you could use code like:

    foreach(var carDetailsRow in carRow.ChildBands[0].Rows)

    Without having a reference to the parent row, or some means to identify it you can’t find the child rows.

    Please let me know if you have any additional questions.

Reply Children