M
mike
I have a page with a LoginView which contains a Gridview and a
DetailsView, each in its own UpdatePanel
The problem that I am experiencing is that when I select a record in
the Gridview (using a SelectButton), the selected record is shown in
the DetailsView, which is correct - however, when I choose "Update" on
the DetailsView I am presented with the EditItemTemplate which
contains the first record in the DetailsDataSource.
The code that changes the selected record in the DetailsView is in the
GridView1.SelectedIndexChanged event as:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs
e)
{
GridView gv1 =
(GridView)LoginView1.FindControl("GridView1");
DetailDataSource.FilterExpression = "ID='" +
gv1.SelectedValue.ToString()+"'";
}
Clicking the "Select" button on the GridView while the DetailsView is
in either "ReadOnly" or "Edit" modes loads the DetailsView with the
correct record - but switching views causes the record to go back to
the default (1st) record.
I am wondering if the update panels may be causing the problem -
should everything be in a single update panel?
It's my first time playing with the control so I'm not sure about all
of the intricacies with it yet.
Any help would be greatly appreciated.
Mike
DetailsView, each in its own UpdatePanel
The problem that I am experiencing is that when I select a record in
the Gridview (using a SelectButton), the selected record is shown in
the DetailsView, which is correct - however, when I choose "Update" on
the DetailsView I am presented with the EditItemTemplate which
contains the first record in the DetailsDataSource.
The code that changes the selected record in the DetailsView is in the
GridView1.SelectedIndexChanged event as:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs
e)
{
GridView gv1 =
(GridView)LoginView1.FindControl("GridView1");
DetailDataSource.FilterExpression = "ID='" +
gv1.SelectedValue.ToString()+"'";
}
Clicking the "Select" button on the GridView while the DetailsView is
in either "ReadOnly" or "Edit" modes loads the DetailsView with the
correct record - but switching views causes the record to go back to
the default (1st) record.
I am wondering if the update panels may be causing the problem -
should everything be in a single update panel?
It's my first time playing with the control so I'm not sure about all
of the intricacies with it yet.
Any help would be greatly appreciated.
Mike