Sep 05, 2013, 1:09 PM
[CLOSED] GridPanel - CheckboxSelectionModel - Set selected rows in a DirectEvent
Hi again, I have a GridPanel with a CheckboxSelectionModel. When the gridview is loaded no row is setted to selected.
But, I have a button to set the selected rows.
Here is the gridpanel:
Any ideas?
But, I have a button to set the selected rows.
Here is the gridpanel:
<ext:GridPanel
runat="server"
ID="GridPanel1"
Frame="true"
MaxHeight="600"
MinHeight="300" >
<Store>
<ext:Store
ID="Store1"
runat="server"
RemoteSort="true" ClearOnPageLoad="true"
PageSize="25" OnReadData="LeerTablaClientesExtNet_Refresh">
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="ID_CLIENTE">
<Fields>
<ext:ModelField Name="NOMBRE_CLIENTE" Type="String" />
<ext:ModelField Name="ID_CLIENTE" Type="Int" />
</Fields>
</ext:Model>
</Model>
<Sorters>
<ext:DataSorter Property="LastName" Direction="ASC" />
</Sorters>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column2" runat="server" Text="Nombre" DataIndex="NOMBRE_CLIENTE" Flex="1" />
</Columns>
</ColumnModel>
<Features>
<ext:GridFilters runat="server" ID="GridFilters1" Local="true">
<Filters>
<ext:ListFilter DataIndex="TIPO" Options="Cliente, Proveedor, Contacto" />
<ext:StringFilter DataIndex="CODIGO_AGENCIA" />
<ext:StringFilter DataIndex="NOMBRE_CLIENTE" />
<ext:StringFilter DataIndex="PaisNombre" />
<ext:StringFilter DataIndex="NOMBRE_CONTACTO_PRINCIPAL" />
<ext:StringFilter DataIndex="MAILS_PREDETERMINADOS" />
<ext:StringFilter DataIndex="TELEFONOS_OFICINA" />
<ext:StringFilter DataIndex="TELEFONOS_PREDETERMINADOS_CONTACTOS" />
<ext:StringFilter DataIndex="PAGINA_WEB" />
<ext:StringFilter DataIndex="CATEGORIAS" />
</Filters>
</ext:GridFilters>
</Features>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Multi" />
</SelectionModel>
<Buttons>
<ext:Button ID="btnRecuperarListaCorreo" runat="server" Text="Recuperar clientes en la lista de correo" Icon="EmailOpen">
<DirectEvents>
<Click OnEvent="RecuperarListaCorreo"></Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:GridPanel>
And the direct event:Public Sub RecuperarListaCorreo(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs)
Dim sm As CheckboxSelectionModel = GridPanel1.GetSelectionModel()
Try
Dim InterfazBD As New Negocio.InterfazClientes()
Dim listaCorreoGuardada As Object = InterfazBD.RecuperarListaCorreo()
For Each cliente In listaCorreoGuardada
CheckboxSelectionModel1.SelectedRows.Add(New SelectedRow(cliente.ID_CLIENTE.ToString))
Next
Catch ex As Exception
MostrarPanelMensaje("alert alert-error", "Error enviando el newsletter. Error: " & ex.Message)
End Try
End Sub
But no rows are checked. The thing is that I put that code in the page_load, it set the selected rows fine.Any ideas?
Last edited by Daniil; Sep 06, 2013 at 3:24 AM.
Reason: [CLOSED]