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
close icon

Reg: Grid databound control

Hi, I have to show last 11 records which present in the history table. For that i am deleting remaining records which present in the dataview and show it into the grid. This is my code: private void FillDetailedHistory(DataView dvLatestHistory) { int rowCount = dvLatestHistory.Count; for (int i = rowCount - 1 ; i >= 11; i--) { dvLatestHistory.Delete(i); } sgbDetailedHistory.BeginUpdate(); sgbDetailedHistory.EnableAddNew = false; this.sgbDetailedHistory.DataSource = dvLatestHistory; sgbDetailedHistory.EndUpdate(true); this.dvSave = dvLatestHistory; } While saving , i am facing problem. Problem is what ever records are present in the grid is updated in the database remaining records are getting deleted from the database. I think problem is, for showing 11 records i am deleting other records. How do i solve this problem.....? Thanks, Anna

1 Reply

AD Administrator Syncfusion Team July 25, 2005 06:28 AM UTC

Instead of deleting the records, you can try hiding them by setting their grid.Model.RowHeights[rowIndex] = 0. Or, you could try making setting the dataTable1.DefaultView.RowFilter to some filter string that will only leave the last 11 rows. (To do this, would require you be able to come up with a filter string. If you had a primary key column for example, and the key had an increasing value for later records, you can filter for this key columns bing greater than or equal to the value of the first record you want to see.)

Loader.
Live Chat Icon For mobile
Up arrow icon