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

Intellisense sorting

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

4 Replies

SK Sarath Kumar G Syncfusion Team June 22, 2007 02:19 AM UTC

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


FZ Frank Zhang June 25, 2007 08:46 PM UTC

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


FZ Frank Zhang June 28, 2007 01:16 PM UTC

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

thanks,

Frank


SK Sarath Kumar G Syncfusion Team June 28, 2007 08:57 PM UTC


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

Loader.
Live Chat Icon For mobile
Up arrow icon