How to bind repeater on grid view row click
i want to bind repeater when click in grid view row using query string when id in null it wiil show all record in repeater on page load and when id is not null it will show selected id record in repeater
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sneha SnehaPosted Apr 20, 2015, 3:37 AM
{
LinkButton lkbtnShowActive = (LinkButton)sender;
GridViewRow row = (GridViewRow)lkbtnShowActive.NamingContainer;
Repeater rep =(Repeater)row.FindControl("Repeater1") as Label;
rep.DataSource = BindActiveRecords(id); // bind ur active records by ur primary key rep.DataBind();
}
protected void onShowAll_Command(object sender, CommandEventArgs e)
{
LinkButton lkbtnShowAll = (LinkButton)sender;
GridViewRow row = (GridViewRow)lkbtnShowAll.NamingContainer;
Repeater rep =(Repeater)row.FindControl("Repeater1") as Label;
rep.DataSource = BindAllRecords(id); // bind ur all records by ur primary key rep.DataBind();
}
hope this will help you.