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

[Solved] Bug RadGridView Q3 2010 IsReadOnly property not working

4 Answers 165 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yvan
Top achievements
Rank 1
Yvan asked on 28 Nov 2010, 05:08 PM

Hi telerik,
I have a grid that can be in edit mode or not depending on user rights.
Each column contains a section CellTemplate and CellEditTemplate. I tried unsuccessfully to affect the properties of IsReadOnly and IsReadOnlyBinding of the definition section of the grid. The grid is unfortunately still in edit mode. I did some research on your forum and I found that I'm not the only one having this problem (see http://www.telerik.com/community/forums/silverlight/gridview/please-please-don-t-change-isreadonlybinding-as-it-is-in-latest-internal-build.aspx ). Question, why the radgrid have two properties for the same purpose (IsReadOnly and IsReadOnlyBinding) ?

Here a sample:

<telerik:RadGridView ItemsSource="{Binding ItemsSource}" 
              AutoGenerateColumns="False" 
              CanUserInsertRows="{Binding CanUserInsertRow}"
              ShowInsertRow="{Binding CanUserInsertRow}"
              IsReadOnly="{Binding IsGridInReadOnlyMode}"
              IsReadOnlyBinding="{Binding IsGridInReadOnlyMode}">
  <telerik:RadGridView.Columns>
     <telerik:GridViewDataColumn DataMemberBinding="{Binding CompanyName}"
                        Header="Company Name" >
        <telerik:GridViewDataColumn.CellTemplate>
           <DataTemplate>
              <TextBlock Text="{Binding CompanyName}" />
           </DataTemplate>
        </telerik:GridViewDataColumn.CellTemplate>
        <telerik:GridViewDataColumn.CellEditTemplate>
           <DataTemplate>
              <TextBox Text="{Binding CompanyName}" />
           </DataTemplate>
        </telerik:GridViewDataColumn.CellEditTemplate>
   </telerik:GridViewDataColumn>

 

Thanks for reply

 

 

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 01 Dec 2010, 04:10 PM
Hello Yvan,

The reported behavior is not a bug since the logic behind is created in such a way that the editing is allowed if a CellEditTemplate is defined. However, we do make some additional considerations on the topic and we reach to the conclusion that it is more expected to be the other way around - once the read-only properties are set to true, editing is not allow. 
Considering the existence of the two properties, although they seem the same and have similar functionality, the idea behind each of them is a bit different. The IsReadOnly property is used for setting the whole grid or a particular column as read only. On the other hand, you may work with IsReadOnlyBinding property when you aim at controlling the editing of a particular cell for example. You may take a look at our online documentation for further reference.

 

Greetings,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Jurjen Ladenius
Top achievements
Rank 2
answered on 01 Feb 2011, 02:44 PM
Does this mean this will be changed in the future? Meanwhile what is the recommended workaround for this scenario?

edit: I'm doing the same, but am using the IsReadOnlyBinding on the column....
0
Maya
Telerik team
answered on 01 Feb 2011, 02:50 PM
Hello Jurjen Ladenius,

This behavior has already been changed. You may download our current official release and give it a try. 

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>>
0
Jurjen Ladenius
Top achievements
Rank 2
answered on 01 Feb 2011, 04:07 PM
Yes, thanks. This is fixed.
Tags
GridView
Asked by
Yvan
Top achievements
Rank 1
Answers by
Maya
Telerik team
Jurjen Ladenius
Top achievements
Rank 2
Share this question
or