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

GridViewComboBoxColumn filter subgrid

3 Answers 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dom
Top achievements
Rank 1
Dom asked on 24 Nov 2011, 11:39 PM
hi,

I have a grid and another grid inside it using the : HierarchyChildTemplate.

In the childtemplate grid, I have 2 : GridViewComboBoxColumn.

I can easily show the list for the first one, unfortunately, the list of the second depends on the first one. I looked at this example : http://www.telerik.com/help/silverlight/radgridview-columns-column-types-combobox-column.html

but I don't think i can make it work since I'm in a subGrid and don't have access to all that information.

Any way to make it work or am I missing something?

thanks
Dom

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 25 Nov 2011, 07:52 AM
Hello Dom,

I would recommend you to run through this blog post for a reference. It illustrates how you can define your GridViewComboBoxColumn-s and the business object so that the source of the second column strictly depends on the value selected in the first one.
 

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Dom
Top achievements
Rank 1
answered on 25 Nov 2011, 06:06 PM
The example in the blog post, is for one grid.

Would it work the same if the grid in question is inside a childtemplate? like these tags?

 

 

 

<telerik:RadGridView.HierarchyChildTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<telerik:RadGridView

 


Not sure I have access to the information.
I'm currently trying to make it work, with no success

Thanks
Dom

0
Accepted
Maya
Telerik team
answered on 28 Nov 2011, 08:06 AM
Hello Dom,

Actually, there should be no major difference whether you are placing those columns in the main grid or in the hierarchy child template. The only thing that will be needed is to define explicitly the Source property of the ItemsSource of the first column. For example:

<telerik:GridViewComboBoxColumn Header="Category"
            DataMemberBinding="{Binding CategoryID}"
            ItemsSource="{Binding Categories, Source={StaticResource mainPageViewModel}}"
            DisplayMemberPath="CategoryName"
            SelectedValueMemberPath="CategoryID" />

Considering the second GridViewComboBoxColumn, you need to set its ItemsSourceBinding to a property from the business object. So, there is no difference whether it is in the child or parent grids, since it depends on the DataContext of the row (which is the data item). 
Let me know in case you need any further assistance.

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Dom
Top achievements
Rank 1
Answers by
Maya
Telerik team
Dom
Top achievements
Rank 1
Share this question
or