The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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.)