0

有没有办法在转发器的 Item_Command 事件中获取转发器的下一行或上一行值?

4

1 回答 1

1

在您的 Item_Command 处理程序中尝试这样的事情:

Button senderButton = (Button)sender;
RepeaterItem currentRepeaterItem = (RepeaterItem)(senderButton.NamingContainer);
int currentRepeaterItemIndex = currentRepeaterItem.ItemIndex;

RepeaterItem previousRepeaterItem = MyRepeater.Items[currentRepeaterItemIndex-1];
RepeaterItem nextRepeaterItem = MyRepeater.Items[currentRepeaterItemIndex+1];
于 2013-05-31T13:56:16.630 回答