Your example hand codes the data into a class which is used to fill your new combobox. I would like to do something of more practical use by filling the combobox using a webservice. It would be really great if you could tell me how this might be done. A working example would be brilliant but I realise that might be asking a bit much. If the following is too unclear to follow, any help on how to use a combox to display data returned from s web service would be very much appreciated.
WEB SERVICE
public List<view_County> GetCounties()
{
DataClassesDataContext db = new DataClassesDataContext();
var query = from d in db.view_Counties
select d;
return query.ToList();
}
(view_Counties returns a single field called County;)
XAML
<UserControl x:Class="TestTelerik.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
Width="400" Height="300">
<StackPanel x:Name="LayoutRoot">
<telerik:RadComboBox x:Name="RadComboBox1" />
</StackPanel>
</UserControl>
CODE
void client_GetCountiesCompleted(object sender, GetCountiesCompletedEventArgs e)
{
// These two lines do not display anything at all, so what do I need to do please.
RadComboBox3.DataContext = e.Result;
RadComboBox3.DisplayMemberPath = "County";
}
Many thanks,
Pete.