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
155
UltraGrid and UltraDataSource data not matching up when grouping is applied
posted

I am having an issue with the incorrect data displaying in my pop-ups when I select the UltraDataSource row based on my grids current active row. I have an object within the ultraDataSource Tag with information that I need to get access to. The following is the call I am making to pass data to my pop-up...

ultraDataSource.Rows[ultraGrid.ActiveRow.Index].Tag

What happens when I interact with the UI?

  • Group the UltraGrid data by one or more columns
  • Select one of the rows in the grouped data and click a UI button to open the row data in a pop-up
  • The selected row data may contain a date begin of 01/01/2010 and date end of 01/01/2011 but the pop up shows different data than that which was selected (i.e. it may show date begin of 02/02/2015 and date end of 02/02/2016)

What is the best way to go about resolving this issue? How can I open the proper UltraDataSource row which corresponds to the selected UltraGrid row?

Parents
  • 4625
    Offline posted

    Hello Devin,

    Thank you for posting in our forums!

    Whenever the UltraWinGrid is grouped or ungrouped, the UltraGrid.ActiveRow.Index represents the index of this row in its parent collection. The value of the Index property of an object can change when objects in the collection are reordered, such as when objects are added to or deleted from the collection. Therefore when the UltraWinGrid is grouped, you have no guarantee that the active layout index is the same as the underlying data one.

    The best way to resolve your issue is to use the property UltraGrid.ActiveRow.ListIndex, which returns the underlying data row, corresponding to the active layout row of the UltraWinGrid. For further reference please refer to our documentation page about ListIndex Property where you can find related code sample.

    Also I have created sample that may be helpful for you. Please see the attached file.

    I am waiting for your response.

    UltraWinGridPopUpSample.zip
Reply Children