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

Silverlight and Telerik ORM

1 Answer 32 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rohan
Top achievements
Rank 1
rohan asked on 11 Apr 2011, 04:20 PM
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

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Apr 2011, 12:17 PM
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
Tags
General Discussions
Asked by
rohan
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or