I have a bunch of repeaters which require similar handling. But the handler requires access, not only to the RepeaterItem which is a subject of the command, but also its containing Repeater.
protected void SpecificRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
{
GenericHandler(e);
}
private void GenericHandler(RepeaterCommandEventArgs e)
{
RepeaterItem row = e.Item;
// Do things with the item.
Repeater table = e.<???>;
// Do things with the repeater.
}
<???>
In the ItemCommand, the source is the Repeater itself, not the button. So cast the source back to a Repeater.
protected void SpecificRepeater_ItemCommand(object source, RepeaterCommandEventArgs e)
{
Repeater repeater = source as Repeater;
GenericHandler(e, repeater);
}
private void GenericHandler(RepeaterCommandEventArgs e, Repeater repeater)
{
}