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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Size of the drop down button in the combobox cell type

Thread ID:

Created:

Updated:

Platform:

Replies:

24524 Feb 5,2005 07:22 PM UTC Aug 7,2014 04:06 PM UTC WinForms 4
loading
Tags: GridControl
khodheir
Asked On February 5, 2005 07:22 PM UTC

In the GridControl If i resize a row containing a combobox celltype the drop down button is resize. How to have a constant size ? I believe in GridBoundControl a combobox celltype have a constant size.

Administrator [Syncfusion]
Replied On February 6, 2005 08:09 PM UTC

Hi, you need to derive a custom renderer from the GridComboBoxCellRenderer and override the virtual OnLayout method. In your override method you can change the new size and position of the button by assigning it to buttonsBounds[0] (buttonsBounds is the last parameter passed into the fn). Another option would be to change the ButtonBarSize of the cell model, e.g. GridDropDownCellModel dm = (GridDropDownCellModel) grid.Model.CellModels["ComboBox"]; dm.ButtonBarSize = new Size(15, 18); Stefan >In the GridControl >If i resize a row containing a combobox celltype the drop down button is resize. How to have a constant size ? >I believe in GridBoundControl a combobox celltype have a constant size.

Jeff Voigt
Replied On February 8, 2006 07:25 PM UTC

This is great, however I''m trying to accomplish the same thing for the NumericUpDown control that can be used in the Grid. I''ve used the same code as described below (but rather with the NumericUpDownCellModal). It simply does not work. Has anyone else figured out how to do this? Thanks! >Hi, > >you need to derive a custom renderer from the GridComboBoxCellRenderer and override the virtual OnLayout method. > >In your override method you can change the new size and position of the button by assigning it to buttonsBounds[0] (buttonsBounds is the last parameter passed into the fn). > >Another option would be to change the ButtonBarSize of the cell model, e.g. > >GridDropDownCellModel dm = (GridDropDownCellModel) grid.Model.CellModels["ComboBox"]; >dm.ButtonBarSize = new Size(15, 18); > >Stefan > > > >>In the GridControl >>If i resize a row containing a combobox celltype the drop down button is resize. How to have a constant size ? >>I believe in GridBoundControl a combobox celltype have a constant size.

Administrator [Syncfusion]
Replied On February 9, 2006 10:17 AM UTC

Hi Jeffrey, 1.First method: public class FNumericUpDownCellModel : GridNumericUpDownCellModel { public FNumericUpDownCellModel(GridModel grid) : base(grid) { base.ButtonBarSize=new Size(40,20); } ................................. } 2.Second Method: public class FNumericUpDownCellRenderer : GridNumericUpDownCellRenderer { protected override Rectangle OnLayout(int rowIndex, int colIndex, GridStyleInfo style, Rectangle innerBounds, Rectangle[] buttonsBounds) { // arrow buttons if (this.OnQueryShowButtons(rowIndex, colIndex, style)) { int arrowButtonWidth = Model.ButtonBarSize.Width+20;//increase or decrease the size of the button ..................... } ..................... } Here is the sample: NumericUpDown_size.zip Let us know if this helps. Thanks for choosing and using Syncfusion Products. Best Regards, Jeba.

Godwin Woo
Replied On August 7, 2014 04:06 PM UTC

What do we return from the OnLayout method? Also, any way we can get these old zip files?

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

;