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

GridControl ButtonBarSize

Thread ID:





21796 Nov 23,2004 01:55 AM UTC Nov 23,2004 08:03 PM UTC WinForms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On November 23, 2004 01:55 AM UTC

I have attempted to change the default button size on the grid by doing something like: grid.TableStyle.CellModel.ButtonBarSize = new Size(24,12); However, the grid seems to ignore this. How do I change the button size to prevent the button from filling the entire cell? I would rather not implement a custom cell for a simple button size specification. Thanks.

Administrator [Syncfusion]
Replied On November 23, 2004 05:18 AM UTC

You have to do this on a CellType basis. SO, to size all comboboxes, use code like: GridCellModelBase model = this.gridControl1.CellModels["ComboBox"]; model.ButtonBarSize = new Size(12, 6);

Administrator [Syncfusion]
Replied On November 23, 2004 04:46 PM UTC

That didn''t seem to work, here is some of the code: grid[1,7].CellType = "PushButton"; grid[1,7].Description = "Click"; grid[1,7].TextColor = Color.Black; grid.CellModels["PushButton"].ButtonBarSize = new Size(10,6); I have tried moving the last line before the other three and it still does not work. Want I want is a button type cell that has a very small button even when the cell itself is very wide. >You have to do this on a CellType basis. SO, to size all comboboxes, use code like: > >GridCellModelBase model = this.gridControl1.CellModels["ComboBox"]; >model.ButtonBarSize = new Size(12, 6); >

Administrator [Syncfusion]
Replied On November 23, 2004 05:06 PM UTC

The PushButton celltype is special. It is designed to be sized to the cell since it is intended to occupy the entire clientarea of the cell. If you do not want the pushbutton to occupy the whole cell, you can set style.BorderMargins.Left, style.BorderMargins.Right, (Top and Bottom) properties to tell the button not to use that part of the cell. The code I gave does work with a ComboBox button.

Administrator [Syncfusion]
Replied On November 23, 2004 08:03 PM UTC

Cool.. the border adjustment worked. Thank you!


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon