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
700
proper way to update/refresh single row in UltraGrid
posted

hi, 

i need to update/refresh single row in the grid. 

i see that the Row has a Refresh method. that is good. 

The only piece i am missing, is how to swap a new object to re-bind this row to. 

i see that the row has ListObject property, but that is read only. 

I basically need a way to 

   1. update that ListObject property

   2. refresh appropriate row

 

the one way i can think of doing this is, 

myObjects = myGrid.DataSource as IEnumerable<MyObject>

<replace object in collection>

myGrid.DataSource = myObjects

MyGrid.Rows[x].Refresh(...)

 

I am not sure this will work correctly, and hoping there is a better way. 

Parents
  • 700
    Verified Answer
    posted

    yep, 

    my solution works. 

    just have to be mindful of Row.Index (visible index) vs Row.ListIndex (index of the underlying object in the array)

    that's what caused me to waste a little time figuring out why wrong items were refreshed. 

Reply Children
No Data