Binding IsReadonly related problem

3 posts, 1 answers
  1. Somogyi
    Somogyi avatar
    7 posts
    Member since:
    Jun 2011

    Posted 14 Oct 2011 Link to this post

    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. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 14 Oct 2011 Link to this post

    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 >>

  3. Somogyi
    Somogyi avatar
    7 posts
    Member since:
    Jun 2011

    Posted 14 Oct 2011 Link to this post

    Hello,

    Thank you Maya!
Back to Top