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

GridViewComboBoxColumn ItemsSourceBinding support for ADO .NET Data service

3 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Monte Baker
Top achievements
Rank 2
Monte Baker asked on 28 Apr 2010, 10:01 PM
Do you have any samples of ItemSourceBinding using ADO.Net Data Services.  I am trying to filter the contents of the comboboxcolumn by an ID column in the GridView, but as yet I have found no references on how to do this when you are consuming data from ADO.Net

Monte Baker

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 29 Apr 2010, 02:10 PM
Hello Monte Baker,

I am not sure we have such example. However please give me  some more details on the logic you need to implement and I wil try to provide some sample code  or guidance.

All the best,
Pavel Pavlov
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.
0
Monte Baker
Top achievements
Rank 2
answered on 29 Apr 2010, 04:54 PM
what I am trying to do is use a gridview to allow a user to create a schedule.  I have a gridview grouped by Days of the Week with each employee listed as the row.  I have the hours or shifts as column headings.  the idea was that each cell would be a combo with the Job Roles that employee was allowed to work.   In the database I have three tables that matter for this, Employee (EmployeeID, Name, Etc.); JobCodes (JobCodeID, JobCode, JobCodeDescription, Etc.); and EmployeeJobCode(EmployeeID, JobCodeID, PayRate, Active).  What I was hoping to achieve was either to be able to load EmployeeJobCode when the grid was loaded and then be able to reference that in the repetitive rows, or to load all of EmployeeJobCode in one object and filter each combo based on that rows employee ID.

With the Begin, endExecute methods with ADO.Net Data Services I have had no look at either method.  the "Driver Sample" at the bottom of http://www.telerik.com/help/silverlight/radgridview-columns-column-types-combobox-column.html is almost exactly what I would like to do, but I dont see any way to use Binding in XAML and set the datasource equal to a BindingCollection object.
0
Pavel Pavlov
Telerik team
answered on 04 May 2010, 03:54 PM
Hello Monte Baker,
I found I have a similar example here.  Please find it attached ( VS2010,RIA and NorthWind  required)
It uses RIA services , but the client side  implementation of the combo column would be the same.

It has a RadGridView  bound to the Orders table of the Northwind database.
For each row it displays a combobox  with Customers filtered by the ShipCountry.

So to achieve this - I have  added a Customers property to the Order Entity . (List<Customer)
This way in XAML I Can use binding like <ComboBoxColumn ItemsSourceBinding={Binding Customers} ...

In your case you will need to add a property to the Employee class - Roles ( e.g. List<Roles> Roles)
to contain the roles filtered by users.

then in XAML use syntax like :
<ComboBoxColumn ItemsSourceBinding={Binding Roles} . . .

If you have troubles implementing this approach , just send me your project ( in a compileable/runable state) and I will make the neccessary modifications. 

Regards,
Pavel Pavlov
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
GridView
Asked by
Monte Baker
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
Monte Baker
Top achievements
Rank 2
Share this question
or