i have one gridview of all employees with check box column.
when i check records, details of that employees comes in second grid view.
now, my first grid view paging works. but the second gridview paging do not work.
i have two problems.
1.when i check some records in first grid view and changes the page, the records displayed in the second gridview are only from current page. previous checks are refreshed. so how do i get those values in next gridview
2.in second grid view when i click to second page. the grid view disappears.
after adding a theme to gridview for paging i have added this code to first grid view
protected void gvDetails_PageIndexChanging1(object sender, GridViewPageEventArgs e)
{
gvDetails.PageIndex = e.NewPageIndex;
string str1 = "SELECT ID, FirstName, LastName FROM EmpMaster";
Command = new SqlCommand(str1, con);
Command.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(Command);
da.Fill(dtLogin);
gvDetails.DataSource = dtLogin;
gvDetails.DataBind();
}
and, this doesnt works for second one,
protected void gvDisplayRecords_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvDisplayRecords.PageIndex = e.NewPageIndex;
gvDisplayRecords.DataSource = dtLogin;
gvDisplayRecords.DataBind();
gvDisplayRecords.Visible = true;
}
so please post the solution.......
[edit]Code block added, "Treat my content as plain text..." option disabled - OriginalGriff[/edit]