This is a migrated thread and some comments may be shown as answers.

Combobox multi-column question

1 Answer 111 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Anthony Pieper
Top achievements
Rank 1
Anthony Pieper asked on 06 Oct 2009, 12:35 PM
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

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 06 Oct 2009, 01:19 PM
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.
Tags
ComboBox
Asked by
Anthony Pieper
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or