DataTypeConverter for DropDownList

1 posts, 0 answers
  1. Timotei
    Timotei avatar
    3 posts
    Member since:
    Jul 2016

    Posted 22 Jun Link to this post

    Hi!

    Is there a way, maybe I'm missing something, to apply a DataTypeConverer to a DropDownList, the same as we are able to do with a column in a RadGridView?

    The idea is that the DisplayMember I need to set is a collection of KeyValuePair. Depending on a key configured externally, I need to choose a specific value. This can be done for grid by applying a custom DataTypeConverter.

    For example, let's say the data source is like the following:

    var dataSource = new List<Entity>{
            new Entity
    {
                int Id = 1;
                string Name = "NameSample";
                Dictionary<int, string> Descriptions = new Dictionary<int, string>
                {
                    {0, "descriptionInEnglish"},
                    {1, "descriptionInGerman"}
                };
            }

    };

    I need to set the DisplayMember of the DropDownList to show the description in a language depending on an external setting.

     

    Thanks!

Back to Top