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

RadGrid Stuck in Edit Mode - Entity Framework

2 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 11 Jan 2013, 01:15 AM
My Grid is stuck in edit mode after hitting Save but not Cancel.

The cause appears to be: AllowAutomaticInserts="true"

So I'm guessing the EntityDataSource has an error on save - how do I get the error?

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Feb 2013, 07:09 AM
Hi,

Unfortunately I couldn't replicate the issue. Here is the sample code snippet I tried.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="EntityDataSourceCustomers" AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
        AllowAutomaticDeletes="true" AllowSorting="true" OnItemCreated="RadGrid1_ItemCreated">
        <MasterTableView DataSourceID="EntityDataSourceCustomers" AutoGenerateColumns="False"DataKeyNames="CustomerID" CommandItemDisplay="Top">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID" SortExpression="CustomerID"
                    UniqueName="CustomerID" Visible="false" MaxLength="5">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContactName" HeaderText="ContactName" SortExpression="ContactName"
                    UniqueName="ContactName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
                    UniqueName="CompanyName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ContactTitle" HeaderText="ContactTitle" SortExpression="ContactTitle"
                    UniqueName="ContactTitle">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" SortExpression="Phone"
                    UniqueName="Phone">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
<asp:EntityDataSource ID="EntityDataSourceCustomers" runat="server" ConnectionString="name=NorthwindEntities35"
DefaultContainerName="NorthwindEntities35" EntitySetName="Customers" OrderBy="it.[ContactName]"
EntityTypeFilter="Customers" EnableUpdate="True" EnableDelete="True" EnableInsert="True"></asp:EntityDataSource>

Thanks,
Shinu.
0
Peter
Top achievements
Rank 1
answered on 05 Feb 2013, 07:44 AM
I had to use SQL Profiler to get the error...
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Peter
Top achievements
Rank 1
Share this question
or