I am using the virtual grid and I want to delete some rows.
When I delete them from my model, they are also cleared from the table. That is all good.
My issue is that the table is not resized. The number of rows stay the same even though it has clearly changed.
Is there a call I can make to invalidate the row count.
Right now I call something like this:
// hoping that some of it will do the trick :)
I still use 1.5. I have tried 1.6 but that didn't help solving this problem.
ADAdministrator Syncfusion Team August 22, 2003 01:39 AM
A couple of comments.
Your code appears to be clearing the contents of the selected rows. This does not actually remove the rows from the grid. If you want to actually remove the rows from the grid, you should use this.gridControl1.Rows.RemoveRange.
But in a virtual grid, calling this.gridControl1.Rows.RemoveRange will not do anything to your data source as you have complete control there (the grid knows nothing about it when you are doing things virtually). What you would need to do, is to directly remove the rows from your external datasource somehow where you are now trying to use the grid to remove the rows. How you would do this depends upon the datasource.
JIJimmyAugust 22, 2003 01:49 AM
I am removing the data from my data model.
They are also removed from the table.
The problem is that it leaves empty rows in the bottom of the table.
The code i pasted is called after removal of data from the data model. It doesn't work really. Was just posting it so you could see what I have been trying out.
ADAdministrator Syncfusion Team August 22, 2003 02:04 AM
By table, do you mean the grid or your exteranl datasource?
If you mean the grid then how are you telling the grid how many rows are there in your datasource? Are you using the QueryRowCount event (and NEVER setting grid.,RowCount = xxxx)?
If you are using QueryRowCount, then after removing the rows from your datasource, call grid.ResetVolatileData().
If you are explicitly setting grid.RowCount, then change this value to what it should be.
JIJimmyAugust 22, 2003 02:21 AM
I only mean to handle the GridQueryCount event.
But if I remove my explicit setting to the RowCount property in the constructor, the grid has loads with a number of empty columns from the start.
Setting the RowCount property again after erasing the cells solved my problem.
Thanks for the *fast* replies!