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
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();
Could you please provide the code snippet for doing the same.
Thanks,
JIJIl
Yeah, you basically need to set the DataSource of the grid to a data source that has a stucture with no rows. If you don't care about the data in your data source, then you can probably clear all the rows fom the data source using a Clear method rather than looping and deleting one row at a time from the grid. But it depends on what you are using as your data source, of course.