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. Image for the cookie policy date
close icon

resizetofit

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

3 Replies

AD Administrator Syncfusion Team 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


KG kgpsan 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


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon