C1FlexGrid DropDown Virtualization

Posted by: murtaza.colombowala on 11 February 2025, 4:27 pm EST

  • Posted 11 February 2025, 4:27 pm EST - Updated 11 February 2025, 4:31 pm EST

    HI,

    We have a list of about 26,000 items that we are trying to map to a dropdown. This is very slow when the dropdown is clicked on (perfectly fine after initial load). I believe C1FlexGrid has virtualization enabled by default, but that does not seem to be working?

    How do we enable that?

    C1.Win.FelxGrid v6.0.20221.5

    This is how the datamap is mapped-

    public void SetFieldDataMap(C1FlexGrid p_flx, string p_sFieldName, IDictionary p_DataMap)
    {
    	int nRowIndex = GetFieldRowEx(p_flx, p_sFieldName);
    	CellRange range = p_flx.GetCellRange(nRowIndex, p_flx.Cols[CommonGridColName.FieldValue].Index);
    	range.StyleNew.DataMap = p_DataMap;
    }

  • Posted 12 February 2025, 4:49 am EST

    Hello,

    DataMap uses an FlexGrid’s internal control based on MS ComboBox, and yes, it is slow for large datasets. So for your requirement, we suggest using C1ComboBox instead. It is fast and loads 26,000 items in the dropdown in no time.

    public void SetFieldDataMap(C1FlexGrid p_flx, string p_sFieldName, IDictionary p_DataMap)
    {
        CellRange range = p_flx.GetCellRange(1, 1);
        var _combo = new C1ComboBox()
        {
            ItemsDataSource = p_DataMap,
            ItemsValueMember = "Key",
            ItemsDisplayMember = "Value",
        };
        range.StyleNew.Editor = _combo;
    }

    Please refer to the attached sample for implementation and let us know if it helps. (see FlexGrid_DropDown.zip)

    => I believe C1FlexGrid has virtualization enabled by default, but that does not seem to be working?

    Apologies, but FlexGrid does not have virtualization enabled by default. For virtualization in FlexGrid, you can refer to https://developer.mescius.com/componentone/docs/services/online-datacollection/virtualization.html.

    Regards,

    Uttkarsh.

  • Posted 12 February 2025, 5:04 pm EST

    Hi Uttkarsh, thank you for the prompt response.

    I tried your suggestion, and while it does seem faster than before, we noticed that the autocomplete feature seems to not be functioning. We tried something like this, but that did not work-

    _combo.AutoCompleteMode = AutoCompleteMode.Suggest;
    _combo.AutoCompleteSource = AutoCompleteSource.ListItems;

    Do you have suggestion for how to get that to work?

  • Posted 13 February 2025, 6:08 am EST

    Hello,

    We were able to observe the behavior with the 2022v1 version. The behavior is not present in the latest version (2024v2 Hotfix 1–693).

    So, we request you to migrate to the latest version of C1 controls to resolve the issue.

    If you still observe the issue, please share a video and details of the issue.

    Regards,

    Uttkarsh.

  • Posted 13 February 2025, 9:45 am EST

    Hi Uttkarsh, we bought the license in 2022, would we qualify for an update to 2024v2? (If not, what is the latest version we can update to where we would not have this autocomplete issue?)

    Also, how do I update the C1 controls? Do I just update the individual nuget packages for

    C1.Win.FlexGrid - 6.0.20221.548

    C1.Wn.Input - 6.0.20221.548

    Really appreciate your help with this, I am new to the ComponentOne world.

    Thanks,

    Murtaza

  • Posted 14 February 2025, 5:21 am EST

    Hello Murtaza,

    The issue has been fixed in the 6.0.20222.566 or higher versions of the FlexGrid.

    => we bought the license in 2022, would we qualify for an update to 2024v2?

    We’re sorry, but with a standard developer license, you are entitled to 1 year of updates. Since you bought your license in 2022 (we are assuming 2022v1), you can upgrade the version up to 2023v1.

    => Also, how do I update the C1 controls? Do I just update the individual nuget packages

    Yes, you are right; just ensure all C1 packages have the same version to avoid any version conflicts.

    Regards,

    Uttkarsh.

  • Posted 21 February 2025, 4:15 pm EST

    Hi Uttkarsh, thanks again! Updating the version did the trick.

    When selecting the item in the comboBox using ID (code snippet below), the display text that the comboBox is displaying is the ID, not the text description. Can you help?

    public void SetFieldValue(C1FlexGrid p_flx, string p_sFieldName, object p_obj)
    {
    	int nRowIndex = GetFieldRowEx(p_flx, p_sFieldName);
    	p_flx[nRowIndex, CommonGridColName.FieldValue] = p_obj;
    }

    Thanks,

    Murtaza

  • Posted 24 February 2025, 7:53 am EST

    Hi Murtaza,

    In C1ComboBox, to show the DisplayMember instead of the ValueMember when a selection is made, set the TranslateValue property to true.

    If you want the DisplayMember to be shown in C1FlexGrid cells after editing, you need to use the DataMap property along with the Editor property. Please note that for the DataMap to work, the column/cell must have a DataType that matches the DataType of the keys in the dictionary.

    We have attached the updated sample project for your reference - FlexGrid_DropDown_DataMap.zip

    In case you still face any issue, please update our sample project to reproduce it, so we can investigate further and assist you better.

    Best Regards,

    Kartik

  • Posted 25 February 2025, 9:35 am EST

    Hi Kartik, that seems to have done the trick! Thanks a lot.

    We will get some more testing done and hopefully that should be the end of this issue.

    Thanks again,

    Murtaza

  • Posted 5 March 2025, 9:24 am EST - Updated 5 March 2025, 4:02 pm EST

    Hi Kartik, we noticed an error that comes up when user tries to type into the field to search-the autocomplete not work, and when the user presses tab or enter to after entering the text there is an error “The entered string cannot be parsed. (Input string was not in a correct format)”.

    This is happening in the sample project too.

          
     public void SetFieldDataMap(C1FlexGrid p_flx, string p_sFieldName, IDictionary p_DataMap)
            {
                CellRange range = p_flx.GetCellRange(1, 1);
                var _combo = new C1ComboBox()
                {
                    ItemsDataSource = p_DataMap,
                    ItemsValueMember = "Key",
                    ItemsDisplayMember = "Value",
                    //Set TranslateValue to true, so that ComboBox shows the DisplayMember
                    TranslateValue = true
                };
                range.StyleNew.Editor = _combo;
                //cell/column must have a DataType set for the datamap to work
                range.StyleNew.DataType = typeof(int);
                //set the datamap along with Editor to show mapped values
                range.StyleNew.DataMap = p_DataMap;
            }

    Could you please advise?

    Thanks,

    Murtaza

  • Posted 6 March 2025, 5:43 am EST

    Hello Murtaza,

    We could observe the issue with the 2023v1 version as well. We checked, and the issue is found to be fixed in the 2023v3—636 version of the control.

    We apologize for the inconvenience, but please update the version of C1 controls to the mentioned version or higher version to resolve the issue.

    Regards,

    Uttkarsh.

  • Posted 6 March 2025, 12:49 pm EST

    Hi Uttkarsh, as per your earlier suggestion it seems like we can only go up to 2023v1, I tried 2023v3—636 but got license error as expected.

    Is there another way to solve this? Maybe an earlier version that has the fix?

    Thanks,

    Murtaza

  • Posted 7 March 2025, 6:13 am EST

    Hi Murtaza,

    The issue was fixed in the 2023v3 (636) release, and unfortunately, the fix is not available in earlier versions. To resolve this, you will need to upgrade your project to the 2023v3 release.

    If your license does not support 2023v3, you can contact the sales team for further details on renewal.

    We apologize for any inconvenience this may have caused.

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels