I am populating my GridView from a Dictionary that stores session state variables. Below is the code which I placed in a button_click Event:
MultiView1.SetActiveView(SessionDataView)
SessionGrid.Visible = True
Dim dictionary As New Dictionary(Of String, String)
dictionary = CreateSessionData() 'populate the dictionary
SessionGrid.DataSource = dictionary
SessionGrid.DataBind()
It displays the first page when the SessionDataView is first loaded (when I click the button). I've set the GridView control to display 20 rows per page. But when I click a page number in the GridView control, it doesn't display anything. It doesn't
behave like a "regular" GridView whose datasource is coming from a SQL Server database (where you can click on the pages and it displays the next rows).
Any suggestion is much appreciated.
Hi,
Found out how to fix this:
Create a Load Event for the View control where the GridView is and place the above method inside the Load Event.
This now lets me click the page numbers and the appropriate rows are loaded.
沒有留言:
張貼留言