Combobox multi-column question

2 posts, 0 answers
  1. Anthony Pieper
    Anthony Pieper avatar
    8 posts
    Member since:
    Jul 2009

    Posted 06 Oct 2009 Link to this post

    I am trying to follow the demo to bind my data and have 2 columns appear in the combobox.

    I see:

         <Grid.DataContext>
                <local:AgencyViewModel />
            </Grid.DataContext>
    and

    <telerikInput:RadComboBox x:Name="RadComboBox1" Width="350" SelectedIndex="0"
                            telerik:TextSearch.TextPath="Name" ItemsSource="{Binding Agency}"
                            ItemTemplate="{StaticResource ComboBoxCustomTemplate}"
                            HorizontalAlignment="Left" />


    My question is where is "AgencyViewModel" coming from and for the ItemSource="{Binding Agency}", what does Agency represent, is this in the C# code itself?

    If there was a better example of databinding with showing multiple columns in the combobox, that would help.

    Thanks
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 06 Oct 2009 Link to this post

    Hi Anthony,

    I extracted and simplified our online example in a separate application. The AgencyViewModel is a simple class that encapsulates the data object (Agency.cs) creation. This way you could easily modify it to use a web service or other way to retrieve your real data objects.

    Please, do not hesitate to ask again if you have specific questions about the example.

    Greetings,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top