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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reg: Grid databound control

Thread ID:

Created:

Updated:

Platform:

Replies:

32182 Jul 25,2005 04:17 AM UTC Jul 25,2005 06:28 AM UTC WinForms 1
loading
Tags: GridControl
Anna Srinivasan
Asked On July 25, 2005 04:17 AM UTC

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

Administrator [Syncfusion]
Replied On 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.)

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;