I am building a comboBox in the ribbon that I would like to use to select a feature based on an attribute value. I have successfully queried the table that holds my attribute values and added them to the comboBox. There are approximately 17,000 unique values in this list. When trying to use the comboBox it is painfully slow. Is there something that I am missing or is there a maximum limit to the number of values this comboBox can effectively handle? Or, have I missed the boat completely and I'm trying to use the comboBox control in a way that it was not intended?
<comboBox id="LOJICTools_ComboBoxFindStreet" isEditable="false" isTextSearchEnabled="true" rows="10" caption="Find Street:" className="ComboBoxFindStreet" itemWidth="140" extendedCaption="Extended Caption" isReadOnly="false" resizable="true">
<tooltip heading="LOJIC Tools Find Street">
Allows the user to zoom to any street in Jefferson County.<disabledText />
</tooltip>
</comboBox>
I am using the following to populate the comboBox:
await QueuedTask.Run(() =>
{
TableDefinition pTD = sifTable.GetDefinition();
Field stNameField = pTD.GetFields().First(x => x.Name.Equals("ROADNAME"));
StatisticsDescription pSD = new StatisticsDescription(stNameField, new List<StatisticsFunction> { StatisticsFunction.Count });
TableStatisticsDescription pTSD = new TableStatisticsDescription(new List<StatisticsDescription> { pSD });
pTSD.GroupBy = new List<Field>() { stNameField };
pTSD.OrderBy = new List<ArcGIS.Core.Data.SortDescription>() { new ArcGIS.Core.Data.SortDescription(stNameField) };
IReadOnlyList<TableStatisticsResult> statResults = sifTable.CalculateStatistics(pTSD);
foreach (TableStatisticsResult result in statResults)
{
if (!Regex.IsMatch(result.GroupBy[0].Value.ToString(), @"^[0-9]+$"))
Add(new ComboBoxItem(result.GroupBy[0].Value.ToString()));
}
_isInitialized = true;
});
Thanks!
Hi,
Take a look how Esri does. Open Select by Attributes tool. And you could find something similar:
It is not efficient to put so much items to combobox.
One of ways is to find WPF autocomplete control source and place inside customcontrol and fill combobox after typing.