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

Size of the drop down button in the combobox cell type

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.

4 Replies

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


JV Jeff Voigt 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.


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


GW Godwin Woo 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?

Loader.
Live Chat Icon For mobile
Up arrow icon