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.

creating a button to reset grid sizes

Thread ID:

Created:

Updated:

Platform:

Replies:

51648 Nov 10,2006 12:01 AM Nov 12,2006 11:56 PM Windows Forms 3
loading
Tags: GridControl
Charlie Mao
Asked On November 10, 2006 12:01 AM

Hi,

I was wondering if someone has a code snippet that allows you to reset the column and row size back to default after the user clicks and make changes to the size. TO be more clear, lets say the user resizes some columns and rows and decides to reset the changes, they can just click on a button. I am using a databoundgrid. Thanks.

Charlie

Administrator [Syncfusion]
Replied On November 10, 2006 01:28 AM

Hi Charlie,

Use the ResetSize method to reset the column/row size to defaultsize. Below is a code snippet

//Reset the Column index..
this.gridControl1.ColWidths.ResetSize(ColIndex);

//Reset the Row index..
this.gridControl1.RowHeights.ResetSize(RowIndex);

//After calling the ResetSize method, you should call the Refresh or Invalidate to repaint the grid.
this.gridControl1.Refresh();

Best Regards,
Haneef

Charlie Mao
Replied On November 10, 2006 02:54 PM

this is for a grid control right? is there a way to do it with a databound grid. Also maybe an example project would be helpful, if its not too much to ask. thank you so much.

charlie

Administrator [Syncfusion]
Replied On November 12, 2006 11:56 PM

Hi Charlie,

Yes. The above code snippet is for GridControl. You can access the ResetSize method from the Model.RowHeights class. Please refer to the attached sample which implements the ResetSize method and let me know if you trying something different.

Sample : http://www.syncfusion.com/Support/user/uploads/ResetSize_3dfc130b.zip

Best Regards,
Haneef

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.

;