Note that there are some explanatory texts on larger screens.

plurals
  1. POPaging Problems With Standard .net 2.0 Gridview using VB.Net
    primarykey
    data
    text
    <p>I am using a standart .net 2.0 Gridview which uses an XMLDatasource to populate the Grid. The Data property of the XMLDatasource is set dynamically which allows the gridview to change based on input.</p> <p>All this works fine however I am having problems with paging...</p> <p>I have set the AllowPaging Property to "true" and set the PageSize Property to "10". The GridView populates fine the first time around showing the first 10 records and the number of pages as hyperlinks at the bottom, BUT when i try to click on any of the page numbers to view them a message box pops up saying "Object reference not set to an instance of an object"</p> <p>any ideas what I'm doing wrong?? or is there anything i need to do which i have missed out on??</p> <p>Code currently being used;</p> <p>Gridview...</p> <pre><code>&lt;asp:GridView ID="GridView1" Runat="server" DataSourceID="XmlDataSource1" AutoGenerateColumns="False" AllowPaging="True" style="width:100%; height:100%;" EnableViewState="False"&gt; &lt;SelectedRowStyle BackColor="Red" /&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="TYPE" HeaderText="TYPE" SortExpression="TYPE" /&gt; &lt;asp:BoundField DataField="DESCRIPTION" HeaderText="DESCRIPTION" SortExpression="DESCRIPTION" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>XMLDatasource...</p> <pre><code>&lt;asp:XmlDataSource ID="XmlDataSource1" runat="server" TransformFile="~/XML/grid2.xslt" EnableCaching="False"&gt; &lt;/asp:XmlDataSource&gt; </code></pre> <p>vb.net code which sets the Data property of the XMLDatasource...</p> <pre><code>Private Sub btnTest_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnTest.Click XmlDataSource1.Data = _testLib.GetGridXML(_Num) GridView1.DataBind() End Sub </code></pre> <p>where _testLib.GetGridXML is a function that returns an XML string based on the _Num passed in.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload