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
455
How can I clear all the rows in a grid without removing the header as well?
posted

Hi,

I want to remove all the rows in a wingrid. If I use grid.datasouce = nothing, the header in the grid would be also removed. So the time being, I can only do so by using a loop:

For each row as UltraGridRow in grid.rows

        row.delete()

Next

Is there any more efficient way to do what I want? Thanks!

Tom

Parents
  • 1360
    posted

    You shouln't set your datasource to NULL, that way, you remove the binding and you lose you datasource information used to determine the header.

    Try setting your datasource to an empty objectlist, or, if you use datatable, set your datasource = datatable.Clone();

Reply Children
No Data