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
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Sneha Sneha77 reputationPosted Apr 19, 2015, 11:37 PM EDT
{
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.