Feb 09, 2009, 9:29 AM
[CLOSED] GridPanel RowSelectionModel
Hello,
I'm having a problem with the row selection model and postback events, please see the simplified example which demonstrates the issue and the replication steps below.
Example.aspx:
1. Load page
2. Select Timothy
3. Click the Edit button; notice the label returns "You selected: 0"
4. Use the next page arrow on gridpanel
5. Select Geoffrey
6. Click the Edit button; notice the label returns "You selected: 0" [wrong]
7. Use the next page arrow on gridpanel
8. Select Vladsch
9. Click the Edit button; notice the label still returns "You selected: 0" [wrong]
Cheers,
Timothy
I'm having a problem with the row selection model and postback events, please see the simplified example which demonstrates the issue and the replication steps below.
Example.aspx:
<%@ Page Language="C#" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Store1.DataSource = new object[] {
new object[] { 0, "Timothy" },
new object[] { 1, "Geoffrey" },
new object[] { 2, "Vladsch" }
};
Store1.DataBind();
}
protected void btnEdit_Click(object sender, EventArgs e)
{
lblResult.Text = String.Concat("You selected: ", SearchResultSelection.SelectedRecordID);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Example</title>
</head>
<body>
<form runat="server">
<ext:ScriptManager runat="server" AjaxViewStateMode="Include" StateProvider="Cookie" Theme="Gray" />
<asp:ScriptManager runat="server" EnablePartialRendering="True" />
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ext:Store ID="Store1"
runat="server"
AutoLoad="True">
<Reader>
<ext:ArrayReader ReaderID="CustomerId">
<Fields>
<ext:RecordField Name="CustomerId" />
<ext:RecordField Name="Customer" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:GridPanel ID="GridPanel1"
runat="server"
StoreID="Store1"
AutoHeight="True"
AutoExpandColumn="Customer"
ButtonAlign="Right"
FireSelectonload="True"
Stateful="True"
StripeRows="True"
Width="400">
<TopBar>
<ext:Toolbar runat="server">
<Items>
<ext:ToolbarButton ID="btnEdit" runat="server" AutoPostBack="true" onclick="btnEdit_Click" Icon="UserEdit" Text="Edit" />
</Items>
</ext:Toolbar>
</TopBar>
<ColumnModel>
<Columns>
<ext:Column ColumnID="Customer" Header="Customer" DataIndex="Customer" Hideable="False" Sortable="True" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="SearchResultSelection" runat="server" SingleSelect="True" />
</SelectionModel>
<BottomBar>
<ext:PagingToolBar runat="server" StoreID="Store1" DisplayInfo="True" DisplayMsg="Displaying Customers {0} - {1} of {2}" PageSize="1" Width="800" />
</BottomBar>
</ext:GridPanel>
<ext:Label ID="lblResult" runat="server" Text="Waiting ..." />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Replication steps:1. Load page
2. Select Timothy
3. Click the Edit button; notice the label returns "You selected: 0"
4. Use the next page arrow on gridpanel
5. Select Geoffrey
6. Click the Edit button; notice the label returns "You selected: 0" [wrong]
7. Use the next page arrow on gridpanel
8. Select Vladsch
9. Click the Edit button; notice the label still returns "You selected: 0" [wrong]
Cheers,
Timothy