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
200
Problem with hierarchical Grid child rows
posted

 Hi

I have editable hierarchical Grid I get data from child grid with this way


for (int j = 0; j < this.SupplierListUltraWebGrid.Rows[i].Rows.Count;j++ )
 {
                UltraGridRow gridRows = new UltraGridRow();
                gridRows = SupplierListUltraWebGrid.Rows[i];
                string idSupplier = gridRows.Rows[j].Cells.FromKey("SupplierName").Value.ToString();

string buyerName = gridRows.Rows[j].Cells.FromKey("BuyerName").Value == null ? "" : gridRows.Rows[j].Cells.FromKey("BuyerName").Value.ToString();


}

if i have 1 row in the child grid it work fine but  the problem  is when I have multiple rows in the child grid and  the user edit cells, I always get data of the latest row changed and all others rows keep there old data?

 

thinks in advance for your helps 

Regards

Parents
No Data
Reply
  • 45049
    posted

    I'm not entirely certain what you're trying to do here.  All I see is that you're getting two values (idSupplier and buyerName) that both go out-of-scope as the loop completes each time.  I'm assuming there's additional code that you haven't posted here, where you're actually using those values for something.

    If you're trying to respond to the user updating values in the grid, you should probably use the UpdateRow or UpdateRowBatch events, rather than looping through all the rows in the grid.  Both of these events give you a reference to the row that was edited (e.Row).

Children