We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Virtual grid + add new row

When the data source (view) behind the virtual grid is inserted a new row, I used the grid.refresh(), and want to move the current cell to the new added row: this.CurrentCell.MoveTo(GridRangeInfo.Row(newRowIndex )); the new row data was partially displayed, some column cells data are missing. And the grid did not scroll to the current cell. Please help. Thanks.

5 Replies

AD Administrator Syncfusion Team January 27, 2006 03:33 AM UTC

Hui, try calling grid.Model.ResetVolatileData(); grid.UpdateScrollBars(); The call to ResetVolatileData will force the grid to callback into the QueryRowCount event which you probably have overriden in your code and where you return the new row count (including the newly added row ...) Stefan >When the data source (view) behind the virtual grid is inserted a new row, I used the grid.refresh(), and want to move the current cell to the new added row: > this.CurrentCell.MoveTo(GridRangeInfo.Row(newRowIndex )); > >the new row data was partially displayed, some column cells data are missing. And the grid did not scroll to the current cell. Please help. Thanks.


HZ Hui Zhong January 27, 2006 08:11 PM UTC

It doesn''t work for me. ResetVolatileData did force grid to callback into the QueryRowCount event, and the grid row count did increase by 1. But the data is still partially displayed and the scroll bar doesn''t work either. Do you have any example for this scenario? For example, how to add one row in the virtual grid, and heightlight the added row in the grid. Hui >Hui, > >try calling > > >grid.Model.ResetVolatileData(); >grid.UpdateScrollBars(); > > >The call to ResetVolatileData will force the grid to callback into the QueryRowCount event which you probably have overriden in your code and where you return the new row count (including the newly added row ...) > >Stefan > >>When the data source (view) behind the virtual grid is inserted a new row, I used the grid.refresh(), and want to move the current cell to the new added row: >> this.CurrentCell.MoveTo(GridRangeInfo.Row(newRowIndex )); >> >>the new row data was partially displayed, some column cells data are missing. And the grid did not scroll to the current cell. Please help. Thanks.


HZ Hui Zhong January 27, 2006 09:29 PM UTC

Please use this attached sample code. It''s an example from your website. I added one button to add new records. click it, you will see the record was inserted, however, the scroll bar doesn''t work in this scenario. Thanks. >Hui, > >try calling > > >grid.Model.ResetVolatileData(); >grid.UpdateScrollBars(); > > >The call to ResetVolatileData will force the grid to callback into the QueryRowCount event which you probably have overriden in your code and where you return the new row count (including the newly added row ...) > >Stefan > >>When the data source (view) behind the virtual grid is inserted a new row, I used the grid.refresh(), and want to move the current cell to the new added row: >> this.CurrentCell.MoveTo(GridRangeInfo.Row(newRowIndex )); >> >>the new row data was partially displayed, some column cells data are missing. And the grid did not scroll to the current cell. Please help. Thanks.

InsertDeleteSample.zip


ST stanleyj Syncfusion Team January 30, 2006 04:47 AM UTC

Hi Hui, Here is a small sample in which, a button handler adds a new row to a virtual grid. Let me know if that does not help. Best regards, Stanley


HZ Hui Zhong January 30, 2006 06:48 PM UTC

It works. Thanks. >Hi Hui, > >Here is a small sample in which, a button handler adds a new row to a virtual grid. Let me know if that does not help. > >Best regards, >Stanley

Loader.
Live Chat Icon For mobile
Up arrow icon