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.

Changing RowCount of Grid at runtime

Thread ID:

Created:

Updated:

Platform:

Replies:

62837 Jun 22,2007 02:54 PM Jun 25,2007 05:05 AM ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
shashank
Asked On June 22, 2007 02:54 PM

hi,

I am trying to increment / decrement the rows in a grid control at run time.

I do a something like the one belwo

((System.ComponentModel.ISupportInitialize)(this.categoryGrid)).BeginInit();
if(inc)
this.categoryGrid.RowCount += 1;
else
this.categoryGrid.RowCount -= 1;
((System.ComponentModel.ISupportInitialize)(this.categoryGrid)).EndInit();


The next time I call categoryGrid.refresh() the count goes back to the original value and my rows in the view also get lost ....How can i change the rowCount at run time and retain them . Someone please throw light on this.

-Shashank

Administrator [Syncfusion]
Replied On June 25, 2007 05:05 AM

Hi Shashank,

You can increase or decrease the rowcount using this code snippet:

grid.RowCount = grid.RowCount +1;//Increase
grid.RowCount = grid.RowCount -1;//Decrease


Here is a small sample:
http://websamples.syncfusion.com/samples/Grid.Windows/F62837/main.htm

The other comment is that it is much quicker to add all the rows or columns at one time, than it is to add then row or cols one at the time. So, if you want to add 500 rows, use code like
grid.RowCount = grid.RowCount + 500 instead of grid.RowCount += 1 five hundred times.

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.


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.

;