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

Binding IsReadonly related problem

2 Answers 69 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Somogyi
Top achievements
Rank 1
Somogyi asked on 14 Oct 2011, 09:15 AM
Hello,

This is my code:

<telerik:RadGridView x:Name="radGridView" Grid.Column="2" Grid.Row="1" Grid.RowSpan="6" Grid.ColumnSpan="2" Margin="0,3,0,3" ShowGroupPanel="False"
                                    SelectedItem="{Binding Path=SelectedMember, Mode=TwoWay}"
                                    ItemsSource="{Binding Task.Keys, Mode=TwoWay}" AutoGenerateColumns="False">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn Header="Display Title" DataMemberBinding="{Binding DisplayTitle, Mode=OneTime}" IsReadOnly="True"/>
               <telerik:GridViewComboBoxColumn Header="Sql Operator" ItemsSourceBinding="{Binding SqlOperatorList, Mode=OneTime}" DataMemberBinding="{Binding SqlOperatorValue, Mode=TwoWay}"/>
               <telerik:GridViewComboBoxColumn Header="Value List" ItemsSourceBinding="{Binding ValueListOfTheKey, Mode=OneTime}" DataMemberBinding="{Binding ValueListOfTheKeyValue, Mode=TwoWay}"/>
               <telerik:GridViewComboBoxColumn Header="Logical Operator" ItemsSourceBinding="{Binding LogicalOperatorList, Mode=OneTime}"
                                               DataMemberBinding="{Binding LogicalOperatorValue, Mode=TwoWay}"
                                               IsReadOnly="{Binding Test}"/>                              
            </telerik:RadGridView.Columns>
            </telerik:RadGridView>

The question is why IsReadOnly goes to the ViewModel for getting Test property. That property is in my TaskKey class, for example DisplayTitle is in that class and binding works correctly for that property.
Why IsReadonly looks into ViewModel, and does not go to look into TaskKey class? (check radGridView ItemSource - that is not applied to IsReadOnly)
How Could I achive that?

Thanks for any help...

2 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 14 Oct 2011, 09:44 AM
Hi Somogyi,

You need to use IsReadOnlyBinding instead of IsReadOnly. Please refer to our online documentation for a reference.
 

Best wishes,
Maya
the Telerik team

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

0
Somogyi
Top achievements
Rank 1
answered on 14 Oct 2011, 10:19 AM
Hello,

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