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.

ComboBoxAdv missing OwnerDraw and DrawItem

Thread ID:

Created:

Updated:

Platform:

Replies:

119405 Jun 16,2015 04:41 PM Jun 17,2015 07:23 AM Windows Forms 4
loading
Tags: ComboBoxAdv
Vince
Asked On June 16, 2015 04:41 PM

I am creating a comboBox to show a list of line thickness items.
With the conventional MS ComboBox I can set to OwnerDraw and then call DrawItem to create line thickness examples directly on the combo's initial draw.

It seems that the ComboBoxAdv is missing OwnerDraw and DrawItem.
Yes I can work around by creating another loop to create images and then loop through to add the images to the ComboBoxAdv, but that's about as clunky as a Model A Ford.

Vince
Replied On June 16, 2015 04:50 PM

...just to further explain why I want DrawItem. The line thickness graphics are created on the fly in the same color that the operator had selected ...just so the operator gets a nice warm fuzzy feeling.

Ashwini Jaya Preetha Durai Samy [Syncfusion]
Replied On June 17, 2015 06:57 AM

Hi Vince,

Thank you for using Syncfusion products.

This reported requirement for customizing ComboBoxAdv items can be achieved by using DrawMode property and DrawItem event in ComboBoxAdv ListBox. Please refer the below code snippet for your reference.

Code snippet [C#]:


// DrawMode in ComboBoxAdv

this.comboBoxAdv1.ListBox.DrawMode = DrawMode.OwnerDrawFixed;

//DrawItem event in ComboBoxAdv
comboBoxAdv1.ListBox.DrawItem += new DrawItemEventHandler(ListBox_DrawItem);


We have also prepared a sample for your reference and it can be downloaded from the following location.

Sample Location: http://www.syncfusion.com/downloads/support/forum/119405/ze/ComboBoxAdvDrawItem-1319896049

Please look into the sample and kindly let us know if it helps.

Regards,
Ashwini

Vince
Replied On June 17, 2015 07:17 AM

comboBoxAdv1.ListBox.DrawMode
Ahhh...perfect.

Thanks

Ashwini Jaya Preetha Durai Samy [Syncfusion]
Replied On June 17, 2015 07:23 AM

Hi Vince,

Thank you for your update.

We are glad that we have helped you on this.

Please let us know if you need any further assistance,

Regards,
Ashwini

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.

;