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

[Solved] GridviewDataColumn This EntitySet of Type blah does not support the 'Edit' operation.

0 Answers 225 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.
Stephen
Top achievements
Rank 2
Stephen asked on 20 Jun 2011, 08:59 AM
I had the following XAML 

<telerik:GridViewDataColumn Header="Title" DataMemberBinding="{Binding Path=Object.PropertyName, Mode=OneWay}" IsReadOnly="True" />

Which when I had made a change to the first column (not shown) set the value of the Object and thus the PropertyName value... when I pressed Escape twice to undo the new row I got an exception in the generated domain service code (using Entity Framework) of 
This EntitySet of Type 'propertyName' does not support the 'Edit' operation.

The value it is trying to set is null. Even with Mode=OneWay, and the IsReadOnly set on the GridViewDataColumn, it still trys to undo the changes back to the null (which was the starting value). 

The way around this is to use a customised GridViewDataColumn with no CellEditTemplate. 

<telerik:GridViewDataColumn Width="Auto" >
    <telerik:GridViewDataColumn.Header>
        <TextBlock TextWrapping="Wrap" Text="Title" />
    </telerik:GridViewDataColumn.Header>
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Path=Object.PropertyName, Mode=OneWay}" />
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>

Hope that helps someone, and it might even be a bug in the GridViewDataColumn? I'd expect a oneway binding, or even the IsReadOnly to not try to call the setter on the property?
Tags
GridView
Asked by
Stephen
Top achievements
Rank 2
Share this question
or