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.

Intellisense sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

62763 Jun 21,2007 09:47 AM Jun 28,2007 04:57 PM Windows Forms 4
loading
Tags: EditControl
Frank Zhang
Asked On June 21, 2007 09:47 AM

Hi,

The ContextChoiceList and ContextPrompt both automatically sort their entries based on alphabetical order. Is there a way to turn this off or implement my own sorting algorithm?

thanks,

Frank

Sarath Kumar G [Syncfusion]
Replied On June 21, 2007 10:19 PM

Hi Frank,

Thank you for your interest in Syncfusion products.

Yes it is possible to sort ContextChoice entries based on algorithm. To demonstrate this issue, I have created a sample for your reference, which sorts the ContextChoice Items in reverse alphabetical order. Please have a look at the sample and let me know if you face any issues.

Here is the sample for your reference.

Intellisense.zip

Regards,
Sarath

Frank Zhang
Replied On June 25, 2007 04:46 PM

Hi,

The sample is helpful, but not quite what I was looking for. I forgot to mention that the ContextChoice inputs come from editcontrol.language.lexems. The language configuration comes from an XML file, and is opened using editcontrol.configurator.open. The editcontrol's configurator is what seems to be sorting the inputs from the file. Please let me know if I can override this behavior and extract the language information without having to sort it.

thanks,

Frank Zhang

Frank Zhang
Replied On June 28, 2007 09:16 AM

I'm still waiting on an update on this. Should I start a direct-trac incident for this?

thanks,

Frank

Sarath Kumar G [Syncfusion]
Replied On June 28, 2007 04:57 PM


Hi Frank,

Sorry for the delayed response.

It is possible to sort "ContextChoice" entries based on a algorithm considering lexems as input from 'config.xml' file. This is achived by extracting the "BeginBlock" values from config.xml file. The following is the code snippet to do so;


[C#]

//Extracting lexems values to string array.
for (int i = 0; i < editControl1.Language.Lexems.Count; i++)
{
Console.WriteLine("Value" + ((ConfigLexem)obj[i]).BeginBlock);
s[i] = ((ConfigLexem)obj[i]).BeginBlock;
}

To demonstrate this issue, I have created a sample for your reference, which extracts the lexems from the 'config.xml' file and sorts the "ContextChoice" Items in reverse alphabetical order. Here is the sample for your reference.

http://websamples.syncfusion.com/samples/Edit/F-62763/main.htm

Please let me know if you face any issues.

Regards,
Sarath

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.

;