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.
Syncfusion Feedback

resizetofit

Thread ID:

Created:

Updated:

Platform:

Replies:

43639 Apr 27,2006 09:45 PM UTC May 1,2006 09:52 AM UTC Windows Forms 3
loading
Tags: GridControl
kgpsan
Asked On April 27, 2006 09:45 PM UTC

I need to resize a row, I have a text box and a pushbutton in the row, and when I do a resizetofit on rowheights, the button also resize''s it size to fit the entire column, is it possible to keep the button to its default size. I have posted a sample app, herewith. And the version used is .Net 2003 with syncfusion 2.0.5.1. Thanks, Shankar

SampleApp.zip

Administrator [Syncfusion]
Replied On April 28, 2006 04:40 AM UTC

Hi Shankar, You need to handle the Grid''s DrawCellButton event to keep the pushbutton size.Here is a code snippet private void gridControl1_DrawCellButton(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellButtonEventArgs e) { if(e.Style.CellType == "PushButton") { int width = 64; int height = 17; e.Button.Bounds = new Rectangle(e.Button.Bounds.X,e.Button.Bounds.Y,width,height); } } Please let me know if you need any further assistance. Thanks for choosing Syncfusion Products. Regards, Haneef

kgpsan
Replied On April 28, 2006 03:32 PM UTC

Thanks for the code, Haneef. But the entire column is able to pick the mouseclick event, Is there any way in which I can clip only the button bounds to pick the mouse click event. Thanks, shankar

Administrator [Syncfusion]
Replied On May 1, 2006 09:52 AM UTC

Hi Shankar, Please try this code to cancel the mouse click.Here is a code snippet. if( e.CellButton != null ) { if( rect.IntersectsWith(new Rectangle(e.MouseEventArgs.X ,e.MouseEventArgs.Y ,1,1) )) { flag = false; } else { flag = true; } } Here is a modified sample. http://www.syncfusion.com/Support/user/uploads/SampleApp_32b0256e.zip Please let me know if you need any further assistance. Thanks for choosing Syncfusion Products. 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.

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

;