View Full Version : Problem with Update ASP "Formview" and Coolite "Gridpanel" in one aspx

Simon King
Dec 16, 2008, 6:29 AM
Hi all, I've try to use coolite coding on a asp.net page which need access/update on one master table and a linked subtable, same structure as [order] and [orderdetail].
The page "OrderDetail.aspx" is intend to provide view/update function in one page, I use asp:formview to display data from SQL datasource, and use ext:GridPanel to show orderdetail grid.

When user create a new order, input order detail on grid and click submit button, I need to call FormViewOrder.InsertItem() to insert data in master table, and get the new id @id from reture value, then update all OrderId in subtable and save, via call client function #{GridPanelOrderList}.save() in listener.

I try to attach the AjaxEvents and Listener in one button, but they seems work seperately, so cause new OrderID can't be retrieve when gridpanel update. For temp solition, I split them in too button, just like below:


<asp:SqlDataSource ID="SqlDataSourceOrder" runat="server"
selectcommand = "SELECT * FROM TB_Order"

<asp:SqlDataSource ID="SqlDataSourceOrderDetail" runat="server"
selectcommand = "SELECT * FROM TB_OrderDetail where OrderID=xxx"

<ext:Store ID="StoreOrderDetail" runat="server" DataSourceID="SqlDataSourceOrderDetail"
OnBeforeRecordInserted ="StoreOrderDetail_BeforeRecordInserted"
<ext:JsonReader ReaderID="OrderDetailID">
<ext:RecordField Name="OrderID" />


<asp:FormView ID="FormViewOrder" runat="server" DataKeyNames="OrderID" DataSourceID="SqlDataSourceOrder" DefaultMode="Insert">

<ext:GridPanel ID="GridPanelOrderDetail" runat="server" StoreID="StoreOrderDetail"


<ext:Button ID="btnNext1" runat="server" Text="Save Order" Icon="Accept">
<Click OnEvent="SaveOrder">

<ext:Button ID="btnNext2" runat="server" Text="Save Order Detail" Icon="Accept">
<Click Handler="#{GridPanelOrderDetail}.save();" />

My question are:
1. how can I combine they together ?
2. I fell it's not a good solution to use formview and gridpanel together, because they are using different programing method, is there any solution in coolite to replace forview/detail view work with datasource and store?

Pls kindly help, thanks a lot!

Dec 16, 2008, 11:56 AM
Have you taken a look at these examples:



The first demonstrate how to bind editable data from a SqlDataSource to an ext:GridPanel control while handling the inserting, updating and deleting using Ajax.

And the second demonstrates how to bind a FormGroup to a GridPanel selection.

Simon King
Dec 16, 2008, 1:40 PM
Dear mindcore1, thanks for your reply, but it semmes not what I need, my problem is the different update method of formview and gridpanel. Also the 2nd example is list / detail view, the value in detail form is update one by one in event handler, not binding with store or datasource, so not same problem in my coding.
Any way, still thanks a lot.

Sep 18, 2009, 5:31 AM
Hi Simon,

Have you found any solution?. I am also in need of same thing.

If so then please share with me.