Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing entitydatasource with editable gridpanel
    primarykey
    data
    text
    <p>i am new at ext.net. i am trying to make an editable grid with using entitydatasource</p> <p>Here is code:</p> <pre><code>&lt;asp:EntityDataSource ID="EntityDataSource1" runat="server" AutoGenerateOrderByClause="True" ConnectionString="name=Sample1Entities" DefaultContainerName="Sample1Entities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="Customer" EntityTypeFilter="Customer" OnUpdating="EntityDataSource1_OnUpdating" &gt; &lt;ext:GridPanel runat="server" ID="GridPanel1" Height="570" Title="Customers" Frame="true"&gt; &lt;Store&gt; &lt;ext:Store ID="Store1" runat="server" DataSourceID="EntityDataSource1" AutoSync="true" IDMode="Client"&gt; &lt;Model&gt; &lt;ext:Model ID="Model1" runat="server"&gt; &lt;Fields&gt; &lt;ext:ModelField Name="CustomerId" Mapping="CustomerId" /&gt; &lt;ext:ModelField Name="Name" /&gt; &lt;ext:ModelField Name="Surname" /&gt; &lt;/Fields&gt; &lt;/ext:Model&gt; &lt;/Model&gt; &lt;/ext:Store&gt; &lt;/Store&gt; &lt;ColumnModel ID="ColumnModel1" runat="server"&gt; &lt;Columns&gt; &lt;ext:Column ID="Column1" runat="server" DataIndex="CustomerId" Text="CustomerId" Width="150" /&gt; &lt;ext:Column ID="Column2" runat="server" DataIndex="Name" Text="Name" Width="150"&gt; &lt;Editor&gt; &lt;ext:TextField runat="server" &gt;&lt;/ext:TextField&gt; &lt;/Editor&gt; &lt;/ext:Column&gt; &lt;ext:Column ID="Column3" runat="server" DataIndex="Surname" Text="Surname" Width="150" /&gt; &lt;/Columns&gt; &lt;/ColumnModel&gt; &lt;SelectionModel&gt; &lt;ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Multi" /&gt; &lt;/SelectionModel&gt; &lt;Plugins&gt; &lt;ext:CellEditing ID="CellEditing1" runat="server" /&gt; &lt;/Plugins&gt; &lt;/ext:GridPanel&gt; </code></pre> <p>There is no problem with entity class. I generated it from db automaticly and tested. When i edit Name column it gives following error:</p> <pre><code>System.Exception: The key-value pairs that define an EntityKey cannot be null or empty.\r\n Parameter name: record ---&gt; System.ArgumentException: The key-value pairs that define an EntityKey cannot be null or empty.\r\n Parameter name: record\r\n at System.Data.EntityKey.CheckValue(String argumentName, String keyFieldName, Object value, PrimitiveType expectedType)\r\n at System.Data.EntityKey.CheckKeyValues(EntitySet entitySet, IExtendedDataRecord record, String[]&amp; keyNames, Object&amp; singletonKeyValue, Object[]&amp; compositeKeyValues)\r\n at System.Data.EntityKey..ctor(EntitySet entitySet, IExtendedDataRecord record)\r\n at System.Data.Objects.ObjectStateManager.FixupKey(EntityEntry entry)\r\n at System.Data.Objects.EntityEntry.AcceptChanges()\r\n at System.Data.Objects.ObjectContext.AcceptAllChanges()\r\n at System.Web.UI.WebControls.EntityDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)\r\n at System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback)\r\n at Ext.Net.Store.MakeUpdates(IDataSource ds, JArray data) in C:\\Users\\Geoffrey McGill\\Documents\\Visual Studio 2010\\Projects\\Ext.NET\\v2\\Ext.Net\\Ext\\Data\\Store.cs:line 890\r\n at Ext.Net.Store.MakeChanges() in C:\\Users\\Geoffrey McGill\\Documents\\Visual Studio 2010\\Projects\\Ext.NET\\v2\\Ext.Net\\Ext\\Data\\Store.cs:line 829\r\n at Ext.Net.Store.DoSaving(String action, String jsonData, JToken parameters) in C:\\Users\\Geoffrey McGill\\Documents\\Visual Studio 2010\\Projects\\Ext.NET\\v2\\Ext.Net\\Ext\\Data\\Store.cs:line 793\r\n --- End of inner exception stack trace ---\r\n at Ext.Net.Store.DoSaving(String action, String jsonData, JToken parameters) in C:\\Users\\Geoffrey McGill\\Documents\\Visual Studio 2010\\Projects\\Ext.NET\\v2\\Ext.Net\\Ext\\Data\\Store.cs:line 806\r\n at Ext.Net.Store.RaiseAjaxPostBackEvent(String eventArgument) in C:\\Users\\Geoffrey McGill\\Documents\\Visual Studio 2010\\Projects\\Ext.NET\\v2\\Ext.Net\\Ext\\Data\\Store.cs:line 1131 </code></pre> <p>When i edit gridpanel's cell store send following ajax request ;</p> <pre><code>submitDirectEventConfig:{"config":{"serviceParams":"[{\"CustomerId\":\"3 \",\"Name\":\"e\",\"Surname\":\"soyad1 \",\"id\":null}]"}} RowSelectionModel1:[{"RecordID":null,"RowIndex":2}] __EVENTTARGET:ResourceManager1 __EVENTARGUMENT:Store1|postback|updat </code></pre> <p>e</p> <p>thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload