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.

Grid Cell Drop Down Height/Width Change

Thread ID:

Created:

Updated:

Platform:

Replies:

31041 Jun 29,2005 06:45 AM Jul 8,2005 02:55 AM Windows Forms 12
loading
Tags: GridControl
Nick Zdunic
Asked On June 29, 2005 06:45 AM

If I have a Cell with a Drop Down Combo in it how can I change the width and height of the drop down when it visible?

Administrator [Syncfusion]
Replied On June 29, 2005 10:49 AM

To control the height, you set the DropDownRows property in the CurrentCellShowingDropDown event as below:
GridCurrentCell cc = grid.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if(cc != null)
{
	GridComboBoxListBoxPart listBoxPart = (GridComboBoxListBoxPart)cr.ListBoxPart;
	listBoxPart.DropDownRows = yourMaxItemCount;
}
To control the width, you set e.Size = new Size(desiredWidth, e.Size.Height); in teh same event.

Nick Zdunic
Replied On June 30, 2005 01:24 AM

It would also be good to make it user sizeable by dragging the right corner of the drop down. Is this possible? - Probably by supplying my own drop down control to replace the standard one. >To control the height, you set the DropDownRows property in the CurrentCellShowingDropDown event as below: >
>GridCurrentCell cc = grid.CurrentCell;
>GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
>if(cc != null)
>{
>	GridComboBoxListBoxPart listBoxPart = (GridComboBoxListBoxPart)cr.ListBoxPart;
>	listBoxPart.DropDownRows = yourMaxItemCount;
>}
>
> >To control the width, you set > >e.Size = new Size(desiredWidth, e.Size.Height); > >in teh same event.

Administrator [Syncfusion]
Replied On June 30, 2005 04:09 AM

We do not have support for user sizing of the droplists. If you need this, then you would have to derive your own celltypes to manage this. Our ComboBox CellType uses a Windows Forms ListBox object as its droplist. That object also does not support user sizing. So, one try at this would be to derive GridComboBoxListBoxPart (which is the ListBox derived class that the grid actually uses as its droplist) to support user sizing. Then derive our ComboBox celltype. In the renderer class, you would override CreateListBoxPart where you would create and pass back an instance of your sizable listbox.

Nick Zdunic
Replied On June 30, 2005 05:26 AM

Any chance of a working sample showing this sort of code? >We do not have support for user sizing of the droplists. > >If you need this, then you would have to derive your own celltypes to manage this. > >Our ComboBox CellType uses a Windows Forms ListBox object as its droplist. That object also does not support user sizing. So, one try at this would be to derive GridComboBoxListBoxPart (which is the ListBox derived class that the grid actually uses as its droplist) to support user sizing. Then derive our ComboBox celltype. In the renderer class, you would override CreateListBoxPart where you would create and pass back an instance of your sizable listbox.

Administrator [Syncfusion]
Replied On June 30, 2005 06:17 AM

It will be later next week sometime before we can get to this.

Nick Zdunic
Replied On June 30, 2005 11:38 AM

Ok - it would be good to see that sample. Just also, I think this is possible, to also format each item in the list box diffrently. e.g. some items bolded, some italics, some underlined and some a combination of that. I think that is some sort of owener drawn capability in .NET but I haven''t tried it myself. >It will be later next week sometime before we can get to this.

Administrator [Syncfusion]
Replied On July 6, 2005 09:33 AM

Here is a sample link for allowing the dropdown to be user sizable. http://www.syncfusion.com/Support/user/uploads/DynamicDropDown_81dfde0a.zip A couple of things. There is a real estate problem with respect to the scrollbar. So, I put the sizing hotspot in the lower right corner. The other point is that the height sizing is not continuous and is set by setting ((GridComboBoxListBoxPart)this.ListBoxPart).DropDownRows property from teh renderer. I did not try to handle this, so teh sizing only affects the width.

Nick Zdunic
Replied On July 7, 2005 12:24 PM

Good, except in the sample the bound list items are not being drwan in the list. Does using v2.0.5.1 make a difference? >Here is a sample link for allowing the dropdown to be user sizable. > >http://www.syncfusion.com/Support/user/uploads/DynamicDropDown_81dfde0a.zip > > >A couple of things. There is a real estate problem with respect to the scrollbar. So, I put the sizing hotspot in the lower right corner. > >The other point is that the height sizing is not continuous and is set by setting ((GridComboBoxListBoxPart)this.ListBoxPart).DropDownRows property from teh renderer. I did not try to handle this, so teh sizing only affects the width. >

Administrator [Syncfusion]
Replied On July 7, 2005 12:53 PM

I do not see this problem using 3.2.1.0. Here is what I see as I size the window (cursor is not shown in the snapshot.) http://www.syncfusion.com/Support/user/uploads/dynamicDD_c08c3270.zip

Nick Zdunic
Replied On July 7, 2005 04:01 PM

My screen shot shows that the items do not appear. This is running your sample against 2.0.5.1 The upload is not working so please take my word for it - otherwise I can email you the screen shot. Can you try against this version to verify. >I do not see this problem using 3.2.1.0. >Here is what I see as I size the window (cursor is not shown in the snapshot.) > >http://www.syncfusion.com/Support/user/uploads/dynamicDD_c08c3270.zip >

Administrator [Syncfusion]
Replied On July 7, 2005 06:22 PM

I installed the 2051 DLLs. The entries do not show up with those DLLs for me either. They do show up with the current release, 3.2.1.0.

Nick Zdunic
Replied On July 8, 2005 02:55 AM

Oh well - I''ll drop the feature then. Not hugely important and everything else works fine anyway. Thanks for the sample anyway. >I installed the 2051 DLLs. The entries do not show up with those DLLs for me either. They do show up with the current release, 3.2.1.0.

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.

;