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
690
Reset Row Height
posted

Hi,

I have an ultragrid in which user can increase the height of the row.  User can then press a button to reset layout of the grid.

I can reset grouping , filtering and sorting using commands such as Displaylayout.ClearGroupBYColumns(), ColumnFilters.ClearAllFilters(), SortedColums.Clear()

but i am unable to reset the height of row efficiently.

I have already tried using row.PerformAutoSize() but this will be too slow for grid with many rows.

I have also tried doing this:-

                this.ugResult.DisplayLayout.Bands[iband].Override.RowSizing = RowSizing.AutoFree;

                this.ugResult.DisplayLayout.Bands[iband].Override.RowSizingAutoMaxLines = 2;

Is there anyway to reset the row height without reloading the datasource efficently??

Am i missing any built in method that is able to do so?

Thanks
miztaken

 

  • 48586
    Verified Answer
    posted

    Hello,

     

    What I could suggest you is to create a collection which contains UltraGridRows which have been modified (was resized) (you could use BeforRowResize event to add row to this collection) and when you want to reset the height to iterate only onto rows which are in this collection, in order to reset their height. After you have reset those rows to clean the collection.  Please keep in mind that you should detached BeforRowResize, when you reset row height and you should attached to this event after you have reset  those rows. Using this approach you will work only onto rows which were modified.

     

    Please let me know if you have any further questions.