Jan 29, 2011, 6:05 PM
Almost working - Autosave edits from Grid back to SQL Server
Hi All,
I must be missing something simple here. I am testing Ext.Net and as my Hello World I wanted to see how hard it would be to wire up an editable grid. My grid is displayed and editable, and the autosave seems to think it is saving something because the red mod mark disappears after editing, but the database table does not get updated.
Can anyone see what I might be missing?
Thanks,
Dave
I must be missing something simple here. I am testing Ext.Net and as my Hello World I wanted to see how hard it would be to wire up an editable grid. My grid is displayed and editable, and the autosave seems to think it is saving something because the red mod mark disappears after editing, but the database table does not get updated.
Can anyone see what I might be missing?
Thanks,
Dave
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:celerantConnectionString %>"
SelectCommand="SELECT [EMPLOYEE_ID], [STORE_ID], [LAST_NAME], [FIRST_NAME] FROM [TB_EMPLOYEE] ORDER BY STORE_ID, FIRST_NAME, LAST_NAME">
</asp:SqlDataSource>
<ext:Window ID="Window1"
runat="server"
Width="1024"
Height="750"
Border="false"
Closable="false"
X="100"
Y="100"
Plain="true">
<Items>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<West Collapsible="true" MinWidth="175" Split="true">
<ext:Panel ID="Panel1"
runat="server"
Width="175"
CtCls="west-panel"
Title="Navigation"
Collapsed="true"
Padding="5"
Html="Treeview will go here"
/>
</West>
<Center>
<ext:GridPanel ID="GridPanel1" runat="server" Height="300" Title="Title" AutoDataBind="True" StripeRows="true">
<Store>
<ext:Store runat="server" DataSourceID="SqlDataSource1" AutoSave="true" UseIdConfirmation="false" AutoDataBind="true">
<Reader>
<ext:JsonReader IDProperty="EMPLOYEE_ID">
<Fields>
<ext:RecordField Name="STORE_ID" />
<ext:RecordField Name="LAST_NAME" />
<ext:RecordField Name="FIRST_NAME" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column Header="Store #" Width="30" DataIndex="STORE_ID"/>
<ext:Column Header="First" Width="150" DataIndex="FIRST_NAME">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
<ext:Column Header="Last" Width="150" DataIndex="LAST_NAME">
<Editor>
<ext:TextField runat="server" />
</Editor>
</ext:Column>
</Columns>
</ColumnModel>
<View>
<ext:GridView ID="GridView1" runat="server" EnableRowBody="true">
</ext:GridView>
</View>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
</SelectionModel>
</ext:GridPanel>
</Center>
</ext:BorderLayout>
</Items>
</ext:Window>
</body>
</html>