Thks geoffrey.
I watched the examples you give me and tested.
Here is my code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test2.aspx.vb" Inherits="Modulo_Admin_Test2" %>
<!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>
<form id="form1" runat="server">
<div>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Label ID="lblTest" runat="server" EnableViewState="true">
</ext:Label>
<ext:Button ID="btnTest" runat="server" Text="Submit" >
</ext:Button>
<ext:Store
ID="Store1"
runat="server" >
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="sFolioCompuesto" />
<ext:RecordField Name="sNombre" />
<ext:RecordField Name="iVersion" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:GridPanel
ID="gpSeguimiento"
runat="server"
StoreID="Store1"
StripeRows="true"
Title="Seguimiento"
Width="800"
Height="300"
AutoExpandColumn="sFolioCompuesto" >
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:RowNumbererColumn />
<ext:Column ColumnID="sFolioCompuesto" Header="Identificación" Width="160" DataIndex="sFolioCompuesto" />
<ext:Column ColumnID="sNombre" Header="Nombre del Documento" Width="160" DataIndex="sNombre" />
<ext:Column ColumnID="iVersion" Header="Rev." Width="160" DataIndex="iVersion" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
</SelectionModel>
<LoadMask ShowMask="true" />
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" >
<Items>
<ext:Label ID="Label1" runat="server" Text="Page size:" />
<ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
<ext:ComboBox ID="ComboBox1" runat="server" Width="80">
<Items>
<ext:ListItem Text="5" />
<ext:ListItem Text="10" />
<ext:ListItem Text="15" />
<ext:ListItem Text="20" />
</Items>
<SelectedItem Value="10" />
<Listeners>
<Select Handler="#{PagingToolbar1}.pageSize = parseInt(this.getValue()); #{PagingToolbar1}.doLoad();" />
</Listeners>
</ext:ComboBox>
</Items>
</ext:PagingToolbar>
</BottomBar>
</ext:GridPanel>
</div>
</form>
</body>
</html>
And in the code behind:
Imports Alestra.SCD.BLL.Admin
Imports Alestra.SCD.BLL.Solicitud
Partial Class Modulo_Admin_Test2
Inherits System.Web.UI.Page
Dim bVar As Boolean = False 'this bool variable is the used to switch the datatable fill
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.lblTest.Text = bVar.ToString()
End Sub
Private Sub LoadGrid()
Dim oSolicitud As New SolicitudAlta()
Dim dtSolicitud As DataTable = Nothing
If Me.bVar = True Then 'change the property than allow me to change te amount of rows returned by the datatable function
oSolicitud.sFolioCompuesto = "PR-PC-VTE-2" 'return one single row
Else
oSolicitud.sFolioCompuesto = "" 'return all the rows in the sql table
End If
dtSolicitud = oSolicitud.List() 'function made by me than loads a datatable from SQL server
Me.Store1.DataSource = dtSolicitud.DefaultView
Me.Store1.DataBind()
End Sub
Protected Sub btnTest_DirectClick(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs) Handles btnTest.DirectClick
LoadGrid()
bVar = Not bVar
Me.lblTest.Text = bVar.ToString()
End Sub
End Class
Now my question is:
When I load the page for the first time, my button works fine, but if I click again, the page has no changes. According to my code, the button must load all rows of the table in my grid in the 1st, 3rd, 5th times and so on; and load only 1 row in the 2nd, 4th, 6th times and so on. This functionality is because I use a bool variable "bVar" (for testing grid).
How can I do for make the button usable not only in its first use? I need to make special stuff with JS to acomplish that?
Thks in advanced.
------
PS:
One of the examples you kindly give me use "asp:SqlDataSource".
But I need to use datatables filled since special classes (created by me) than interact with SQL server, Oracle, etc.
Because of that, I cannot use "asp:SqlDataSource" and put all the SQL-server interaction in the html code.