Multi-source binding

2 posts, 0 answers
  1. William
    William avatar
    1 posts
    Member since:
    Apr 2011

    Posted 21 Oct 2011 Link to this post

    Hi,

    I am fairly new to Telerik so I will explain the issue as best I can.  The goal is to bind the list to an enum and the SelectedValue to a value in another object.

    So, I have a combobox that needs populated from an enum. The enum consists of two strings, ShortName and DisplayText.  I am able to get the combobox to bind and have the DisplayText appear which is great.  With my HTML background I expect to be able to set a DDL's value and text separately.  It appears that if I set the text it sets that as the value as well.  Is this correct?

    The reason for this necessity is that I am attempting to bind the SelectedItem to a value retrieved from a database.  The ShortName property in the enum is being brought back from the database but I need to show the DisplayName. 

    I am used to this being pretty simple.  Anybody know what I am missing here???

    Thanks!

    -Will
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 25 Oct 2011 Link to this post

    Hi William,

    Please, find attached a simple application that demonstrates your request. The idea of data-binding in Silverlight is a little bit different than ASP.NET - in Silverlight you feed the ItemsControl directly with the data items from the database, setting DisplayMemberPath to specify which property should be used for display text (or you could use ItemTemplate instead if you want more complex UI).

    Regards,
    Valeri Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top