Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
AutoComplete Combobox!!
posted

I am trying to make an AutoComplete Combobox in InfragisticsGridControl..

Please provide me sample code...

Thanks..

Parents
  • 2077
    Offline posted

    Frank100 said:
    I am trying to make an AutoComplete Combobox in InfragisticsGridControl..

    First you have to set, through design mode which is easier or programatically, the "Style" of the column: DropDownValidate.

    After that, you have to fill a ValueList with the values available for the combobox column in the grid:

    void SetGridComboBoxValues(List<object> values)
    {
        if (grid.DisplayLayout.ValueLists.IndexOf("ComboValues") == -1)
        {
            grid.DisplayLayout.ValueLists.Add("ComboValues");
        }
        else
        {
            grid.DisplayLayout.ValueLists["ComboValues"].ValueListItems.Clear();
        }

        grid.DisplayLayout.ValueLists["ComboValues"].ValueListItems.Add(null, "-- select --");
        foreach (object value in values)
        {
            grid.DisplayLayout.ValueLists["ComboValues"].ValueListItems.Add(value, value.Name);
        }

        grid.DisplayLayout.ValueLists["ComboValues"].DisplayStyle = ValueListDisplayStyle.DisplayText;
        grid.DisplayLayout.Bands[0].Columns["ColumnKey"].ValueList = grid.DisplayLayout.ValueLists["ComboValues"];
    }

    "ColumnKey" is the key you have set to the column in which you want the combobox to appear, and "ComboValues" has to be an unique string that identifies the ValueList in the ValueLists collection.

    Hope this helps,

    Emanuel

Reply Children