View Full Version : [CLOSED] GridPanel RowSelectModel don´t working

Jan 23, 2012, 3:38 PM

I am doing something wrong, probably!

I declare in my GridPanel the Selection Model as follows

<ext:RowSelectionModel runat="server" Mode="Single" />

I have a button, called btnDetails, when i call with DirectEvent the protect sub ShowDetails

<ext:Button runat="server" ID="btnDetails" Icon="ApplicationEdit" Text="Detalhar">
<Click OnEvent="ShowDetails"
Failure="Ext.MessageBox.alert('Load failed', 'Error during ajax event!');">
<EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={#{grdSugestoes}.body}" />

But, in ShowDetail, the collection SelectedRows allways return 0 in count property, although a selected line in the grid

Protected Sub ShowDetails(sender As Object, e As Ext.Net.DirectEventArgs)
Dim sm As Ext.Net.RowSelectionModel = Me.grdSugestoes.GetSelectionModel()
Dim row As Ext.Net.SelectedRow

If sm.SelectedRows.Count > 0 Then
row = sm.SelectedRows(0) 'Pode ter mais de uma selecioanda, mas pego a primeira, sempre
Me.wndSugestoesDetail.Start(Convert.ToInt64(row.Re cordID.ToString), grdSugestoes.GetStore())
Dim msg As New Ext.Net.MessageBox
msg.Alert("REGISTRO NO SELECIONADO", "Por favor, selecione um registro na lista para ver o detalhamento!")
End If

End Sub

Jan 23, 2012, 4:29 PM

Confirmed, this is a bug. We will investigate.

Thanks for the report.

For now, I can suggest to send required data via an extra parameter.


<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
if (!X.IsAjaxRequest)
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
new object[] { "test1", "test2", "test3" },
new object[] { "test4", "test5", "test6" },
new object[] { "test7", "test8", "test9" },

protected void GetSelectedCount(object sender, DirectEventArgs e)
SelectedRowCollection selectedRows = JSON.Deserialize<SelectedRowCollection>(e.ExtraParams["selection"]);
X.Msg.Alert("Count", selectedRows.Count).Show();
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>

<script type="text/javascript">
var getSelection = function (grid) {
var selection = grid.getSelectionModel().getSelection(),
data = [];

Ext.each(selection, function (r) {
recordID : r.getId()
return data;
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
<ext:Store runat="server">
<ext:Model runat="server" IDProperty="test1">
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
<ColumnModel runat="server">
<ext:Column runat="server" Header="Test1" DataIndex="test1" />
<ext:Column runat="server" Header="Test2" DataIndex="test2" />
<ext:Column runat="server" Header="Test3" DataIndex="test3" />
<ext:RowSelectionModel runat="server" Mode="Single" />
<ext:Button runat="server" Text="Get count of selected rows" OnDirectClick="GetSelectedCount">
<Click OnEvent="GetSelectedCount">
Encode="true" />

Jan 23, 2012, 5:49 PM
Hi Daniil

Tested and working fine

Thanks a lot

Jan 24, 2012, 11:59 AM
It has been fixed in SVN and will appear in DP2.

Thanks again for the report.