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.

Context Choice Item

Thread ID:





99743 Jun 8,2011 10:46 AM Jun 14,2011 01:19 AM Windows Forms 3
Tags: EditControl
Ravinder Merugu-
Asked On June 8, 2011 10:46 AM

Is there any way to add some meta data to context choice items?

Vallarasu S [Syncfusion]
Replied On June 9, 2011 02:19 AM

Hi Ravider,

Thanks for your interest in Syncfusion prodcuts.

Can you please brief your requirement? Therefore I can provide a better solution possible.

Vallaraus S.

Ravinder Merugu-
Replied On June 9, 2011 11:58 AM

Thanks for your response.

We populate context choice item list from our Volabulary Term collection. I want to put Vocabulary Term object in Contect choice item Tag property. But ContextChoiceItem class was not exposed through API. Only way we can add context choice items is through Items.Add property on IContextChoiceController.

Is there any way I can attach our Vocabulary Term object to context choice item, so that I can get it when user selects an item from intellisense.

Vallarasu S [Syncfusion]
Replied On June 14, 2011 01:19 AM

Hi Ravinder,

Thanks for the update.

Implementing the IContextChoiceItem, and adding an API of type object would be the solution, however adding an ContextChoiceItem to the ContextChoiceItemCollection is marked private, and cannot be accessed. Alternatively you can keep a hashtable to store the vocabulary terms with the IContextChoiceItem.ID as the key as follows.

Hashtable VocabularyTerm = new Hashtable();

void edit_ContextChoiceOpen(IContextChoiceController controller)
IContextChoiceItem item = controller.Items.Add("Item 1");

// You can get this value associated with the key later.
VocabularyTerm[item.ID] = "Associated Value";

Let me know if this helps

Vallarasu S.


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.