ComponentOne FlexGrid for UWP
Features / Editing Features / Auto-complete and Mapped Columns
In This Topic
    Auto-complete and Mapped Columns
    In This Topic

    Auto-complete and mapped columns are implemented with a built-in class called ColumnValueConverter. This class deals with two common binding scenarios:

    Auto-complete exclusive mode (ListBox-style editing)
    Columns that can only take on a few specific values. For example, you have a "Country" column of type string and a list of country names. Users should select a country from the list, and not be allowed to enter any countries not on the list.

    You can handle this scenario with two lines of code:

    C#
    Copy Code
    var c = flexgrid1.Columns["Country"];
    c.ValueConverter = new ColumnValueConverter(GetCountryNames(), true);
    

    The first parameter in the ColumnValueConverter constructor provides the list of valid values. The second parameter determines whether users should be allowed to enter values that are not on the list (in this example they are not).

     

    Auto-complete non-exclusive mode (ComboBox-style editing)
    Columns that have a few common values, but may take on other values as well. For example, you have a "Country" column of type string and want to provide a list of common country names that users can select easily. But in this case users should also be allowed to type values that are not on the list.

    You can also handle this scenario with two lines of code:

    C#
    Copy Code
    var c = flexgrid1.Columns["Country"];
    c.ValueConverter = new ColumnValueConverter(GetCountryNames(), false);
    

    As before, the first parameter in the ColumnValueConverter constructor provides the list of valid values. The second parameter in this case determines that the list is not exclusive, so users are allowed to enter values that are not on the list.