I am using a gridview/formview to function as master/detail. The gridview and formview are bound to the same datasource. There is a menu control that controls which formview control to show. Initially, I am setting the selectedindex of the gridview = 0 and displaying the associated formview control (the datasource has 3 records, formview.PageCount = 3). This works without issues. However, when I select another record the formview.PageCount = 3, the formview is populated with the data, once I click another menu item and return to the one previously clicked the formview.PageCount = 1 and the formview.PageIndex = 0;
if (menuItm.Selected = "Status Info")
{
int thisRow = theGrid.SelectedIndex;
if (theForm.PageIndex != theGrid.SelectedIndex)
{
theForm.PageIndex = theGrid.SelectedIndex;
gvwtheGrid_SelectedIndexChanged(theGrid, null)
}
//there is code to show the view which contains the formview
//theForm is set to visible.
How can I persist the Form.PageIndex once it has been set?
Thanks,