[Mono-bugs] [Bug 66474][Wis] New - DataGrids in ASP.NET using VB.NET language only shows 2 pages

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 21 Sep 2004 12:58:28 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by rogerio.araujo@gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=66474

--- shadow/66474	2004-09-21 12:58:28.000000000 -0400
+++ shadow/66474.tmp.20110	2004-09-21 12:58:28.000000000 -0400
@@ -0,0 +1,100 @@
+Bug#: 66474
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: rogerio.araujo@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataGrids in ASP.NET using VB.NET language only shows 2 pages
+
+If you create a DataGrid in ASP.NET with paging feature and add all the
+code to this feature works and click in next link more than two times the
+DataGrid stops the paging, in others words, DataGrid only show two pages.
+
+Steps to reproduce the problem:
+1. Create a ASP.NET page using VB.NET language.
+2. Put a DataGrid in this page like this: 
+
+<asp:datagrid id="dg" 
+	border="1" 
+	AutoGenerateColumns="false"	
+	EnableViewState="false" 
+	runat="server"
+	AllowPaging="True"
+	PageSize="3"
+        OnPageIndexChanged="Paginando"
+	PagerStyle-Mode="NextPrev"
+	PagerStyle-HorizontalAlign="Right"
+	PagerStyle-NextPageText="Proximo"
+	PagerStyle-PrevPageText="Anterior">
+	<Columns>
+		<asp:BoundColumn HeaderText="Nome" DataField="nome"
+ItemStyle-CssClass="Normal" HeaderStyle-Cssclass="Bold" />
+		<asp:BoundColumn HeaderText="Telefone" DataField="fone_contato_1"
+ItemStyle-CssClass="Normal" HeaderStyle-Cssclass="Bold"/>
+		<asp:BoundColumn HeaderText="Endereco" DataField="endereco"
+ItemStyle-CssClass="Normal" HeaderStyle-Cssclass="Bold"/>
+		<asp:BoundColumn HeaderText="E-Mail" DataField="e_mail"
+ItemStyle-CssClass="Normal" HeaderStyle-Cssclass="Bold"/>
+	</Columns>
+</asp:datagrid>
+
+3. Now put a paging code between <server></server> tags like this:
+
+<script runat="server">
+    Function CriarDataSet() As DataSet
+	Dim connectionString as string  = "Server=localhost;Database=dados;User
+ID=root;Password=1978rpa;"
+	Dim dbcon as MySqlConnection 
+	dbcon = New MySqlConnection(connectionString)
+	dbcon.Open()
+	Dim dbcmd as MySqlCommand = dbcon.CreateCommand()
+	Dim sql as string  = "SELECT * FROM cadastros Where nome Like '%'"
+	dbcmd.CommandText = sql
+			
+	Dim adapter as MySqlDataAdapter = New MySqlDataAdapter(dbcmd)
+	Dim dataSet as DataSet          = New DataSet ()
+	adapter.Fill(dataSet, "Contatos")
+			
+	CriarDataSet = dataSet
+    End Function	
+	
+    sub Page_Load (o as object, e as EventArgs) 
+	MontarGrid()
+    end sub	
+    
+    Sub Paginando(sender As Object, e As DataGridPageChangedEventArgs)
+        dg.CurrentPageIndex = e.NewPageIndex
+        MontarGrid()
+    End Sub
+
+    Sub MontarGrid()
+        dg.DataSource = CriarDataSet()
+        dg.DataBind()
+    End Sub	
+</script>	
+
+
+Actual Results:
+The datagrid only show two pages with 3 records each page, but i have 20
+record to be shown...
+
+Expected Results:
+More than two pages when i click on Next link...
+
+How often does this happen? 
+All the time...
+
+Additional Information:
+The datagrid just ignore the click on the Next link in the second page of
+datagrid and loads the second page again, but in this case i have a third,
+fourth, fifth pages...