Silverlight and Telerik ORM

2 posts, 0 answers
  1. rohan
    rohan avatar
    3 posts
    Member since:
    Nov 2010

    Posted 11 Apr 2011 Link to this post

    Hi ,

    I am using Silverlight with telerik ORM.
    Im my Sql database i have 2 tables

    Table1(For combobox)
    Id Name Description

    Table 2
    Id1 Name1 Id(of Table 1) Description

    using the dataservice wizard i have created the service class to these tables in Telerik ORM

    No i need to populate my radGrid view with data from Table2 and the data from Table1 should come as a combobox in the Id(of Table1)
    column

    My code is as follows but i am unable to display the required out put.

    ObservableCollection<Table2> tc = new ObservableCollection<Table2>();

                DataServiceQuery<Table2> query1 = this.dataManagaer.Table2s;
                query1.BeginExecute(
                   (IAsyncResult result) => EntitiesLoaded<Table2>(result, tc),
                   query1);


                ObservableCollection<Table1> bm = new ObservableCollection<Table1>();

                DataServiceQuery<Table1> query2 = this.dataManagaer.Table2s;
                query1.BeginExecute(
                  (IAsyncResult result) => EntitiesLoaded<Table2>(result, bm),
                  query1);

                GridViewComboBoxColumn comboColumn = new GridViewComboBoxColumn();
                comboColumn.Header = " ID & Name";
                comboColumn.DataMemberBinding = new Binding("Id(of Table1)");
                comboColumn.SelectedValueMemberPath = "Id";
                comboColumn.DisplayMemberPath = "Name";
                comboColumn.ItemsSource = bm;
                comboColumn.ItemTemplate = this.Resources["ComboItemTemplate"] as DataTemplate;
                radGridView2.Columns.Add(comboColumn);


                radGridView2.ItemsSource = tc;

    Please could some suggest how this can be done.

    Regards,
    Ron
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Apr 2011 Link to this post

    Hi,

     Please check our combo column demos for more info about how to populate this column in various scenarios. 

    Best wishes,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top