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.
Unfortunately, activation email could not send to your email. Please try again.

DataTable modification doubt

Thread ID:

Created:

Updated:

Platform:

Replies:

10681 Feb 9,2004 09:36 PM Feb 10,2004 03:15 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On February 9, 2004 09:36 PM

Hey, I have a DataTable with few rows pouplated. On some condition, I want the grid to display only the last few rows of the dataTable and few new rows to be added to the end of the last few rows. How do I bring to effect this modification of the DataTable. Thanks..

Administrator [Syncfusion]
Replied On February 9, 2004 09:41 PM

Me again... Just more insight into the doubt - >I have a DataTable with few rows pouplated. On some condition, I want the grid to have only the last few rows of the dataTable and few new rows to be added to the end of the last few rows. Meaning the first few rows of the datatable should be cleared. How do I bring to effect this modification of the DataTable. > >Thanks..

Administrator [Syncfusion]
Replied On February 10, 2004 03:15 AM

If you can pick out the rows you want ot see with a RowFilter string, then you can set the DefaultView.RowFilter property on your datatable. Another way to handle this that does not require being able to write a filter, is to handle teh Model.QueryRowHeight event, and if the e.Index is not one of the rows you want to see, then set its size to 0. //subscribe to the event this.gridDataBoundGrid1.Model.QueryRowHeight += new GridRowColSizeEventHandler(grid_QueryRowHeight); //the handler (showing last 5 rows) private void grid_QueryRowHeight(object sender, GridRowColSizeEventArgs e) { if(e.Index > 0 && e.Index < this.gridDataBoundGrid1.Model.RowCount - 5) { e.Size = 0; e.Handled = true; } }

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.

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.

;