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

Cascading GridViewComboBoxColumns

4 Answers 174 Views
GridView
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 28 Feb 2011, 09:25 PM
I have 2 GridViewComboBoxColumns in my GridView.
The second GridViewComboBoxColumn's ItemsSource is a property of the selected item in the first GridViewComboBoxColumn.

How do I accomplish this in XAML?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 01 Mar 2011, 08:35 AM
Hi,

Did you check out this blog post for a reference ? Is there any difference between the settings in the approach demonstrated there and yours ? Do you want to achieve something similar ? What is the implementation of the business object you want to implement ?
 

Best wishes,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
newbie
Top achievements
Rank 1
answered on 01 Mar 2011, 03:14 PM
Thank you for your reply.
I am unable to view that blog.
It must be the same one that I tried to view yesterday.
I keep getting a time out error with loading the page:

"The connection has timed out
The server at blogs.telerik.com is taking too long to respond."


I don't know if my requirements are different from the ones outlined in the blog because I can't view it.
0
Maya
Telerik team
answered on 01 Mar 2011, 04:27 PM
Hello newbie,

I am sending you the sample project related to the blog post I was referring to.
 

Regards,
Maya
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
newbie
Top achievements
Rank 1
answered on 01 Mar 2011, 08:28 PM
Thank you.

I fixed my problem by using the GridViewComboBoxColumn's ItemsSourceBinding property.
Originally I was looking to do something like the following:
<ComboBox x:Name="MyListingOptions"
      ItemsSource="{Binding Source={StaticResource MyResource}, Path=Listings}"
      SelectedItem="{Binding Path=DataContext, ElementName=MyControlElement}"
      Width="100" FontSize="12">
    <ComboBox.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Listing.Name}"></TextBlock>
        </DataTemplate>
    </ComboBox.ItemTemplate>
</ComboBox>
<StackPanel x:Name="MyControlElement">
  <!-- controls for displaying and manipulating my object/class -->
</StackPanel>

When you select an item in the ComboBox the DataContext of the "MyControlElement" is changed.
I was hoping to do the same thing within the telerik GridView but I think it's probably impossible since you can't refer to the ElementName of the GridViewComboBoxColumn...

Anyways, I was able to find a solution to my problem.

Thank you.
Tags
GridView
Asked by
newbie
Top achievements
Rank 1
Answers by
Maya
Telerik team
newbie
Top achievements
Rank 1
Share this question
or