MultiView and GridView Paging issue

G

Guest

I have a MultiView with two views in it. View1 has a GridView and a
SqlDataSource. View2 has a few link buttons that set the SelectCommand
for the SqlDataSource to show a few reports. Here's the extremely
basic code sample:

Protected Sub btnAll_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnAll.Click
SqlDataSource1.SelectCommand = "SELECT * FROM dbo_ONT_LDAP_LOG"
MultiView1.SetActiveView(View1)
End Sub

Protected Sub btnErrors_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnErrors.Click
SqlDataSource1.SelectCommand = "SELECT * FROM dbo_ONT_LDAP_LOG
WHERE (EntryType = 'Error')"
MultiView1.SetActiveView(View1)
End Sub


The default SelectQuery is: SELECT * FROM dbo_ONT_LDAP_LOG WHERE
(EntryType = 'Error')"

My GridView is paged at 40 records per page. If I click on the link
button to show all records, the GridView populates perfectly with all
of the data(as do all link buttons). However, as soon as I click on
the next page, the GridView shows the data from the Error select
statement. If I remove the default SelectQuery, the GridView states
that 'There are no data records to display.'

ViewState is enabled on everything. Any ideas or suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top