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

GridViewComboBoxColumn Enabling/Disabling ComboBox Items Based on Databinding

1 Answer 345 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 29 Jan 2011, 01:56 AM
I'm not 100% sure if this is possible but I'd love to be able to allow the user to click on some combobox items and not others based on databinding.  So, I want something like this:

<tp:GridViewComboBoxColumn DataMemberBinding="{Binding Column1}" SelectedValueMemberPath="Column2" DisplayMemberPath="Column3" EnabledPath="{Binding Column4}" ItemsSource="{Binding Path=MyData}" Width="*">

The exact syntax doesn't really matter but I believe this communicates what I'm trying to accomplish.  Thanks!

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 31 Jan 2011, 08:14 AM
Hi Dean,

Generally, the property you define in the DataMemberBinding needs to be a part of the source of the RadGridView, while those in the SelectedValueMemberPath and DisplayMemberPath need to be from the ItemsSource of the GridViewComboBoxColumn. Consequently, you cannot bind the last two to properties from the source of the grid (Column2 and Column3 for example).
As far as your exact requirement is concerned, you may take a look at this blog post for a reference. Basically, the idea is that you may create separate source for the GridViewComboBoxColumn based on some conditions.
  

Kind regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Dean
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or