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.

GridControl ButtonBarSize

Thread ID:

Created:

Updated:

Platform:

Replies:

21796 Nov 22,2004 08:55 PM Nov 23,2004 03:03 PM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 22, 2004 08:55 PM

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 12:18 AM

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 11:46 AM

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 12:06 PM

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 03:03 PM

Cool.. the border adjustment worked. Thank you!

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.

;