protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
// e.NewSelectedIndex -> 0 to n
// GridView1.PageCount -> (n-1) always
// GridView1.PageIndex -> 0 to Page#
int rowN = 1 + ((GridView1.PageCount-1) * GridView1.PageIndex + e.NewSelectedIndex);
DetailsView1.HeaderText = "Details View of Row "+ rowN.ToString();
DetailsView1.PageIndex = rowN - 1;
GridView1.SelectedIndex = rowN - 1;
DetailsView1.DataSource = Cache["dt"];
DetailsView1.DataBind();
}
Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.
Sunday, November 25, 2007
How to implement Select on a GridView1 with Paging enabled.
How to implement Select on a GridView1 with Paging enabled based on a DataTable.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(41)
-
▼
November
(11)
- How to implement Ajaxified details view hide on Pa...
- Generate Random numbers
- Implementing Dynamic Hyperlink of Current Page
- Fixing WebForms.PageRequestManagerServerErrorExcep...
- How to implement Select on a GridView1 with Paging...
- How to enable paging on a GridView that is bound t...
- Using Yahoo Mail Web Service hints
- Well documented C# code sample
- Caching Methods in ASP.NET 2.0
- Modifying labels in MasterPage From MasterPage use...
- Setup an email form for .NET 2.0
-
▼
November
(11)
No comments:
Post a Comment