Can someone tell me how can I select the Row under the one on which I Click the Button ?
<asp:Button ID="btnmoveup" runat="server" Text="/\" OnCommand="MoveButton_Clicked"
CommandName="UP" CommandArgument='<%# Eval("ProjectID") + ";"+Eval("Priority")%>'/>
</td>
<td>
<asp:Button ID="btnmovedown" runat="server" Text="\/" OnCommand="MoveButton_Clicked"
CommandName="DOWN" CommandArgument='<%# Eval("ProjectID") + ";"+Eval("Priority")%>' />
The code behind:
protected void MoveButton_Clicked(object sender, CommandEventArgs e)
{
string[] arguments = e.CommandArgument.ToString().Split(new char[] {';'});
string pid1;
int prior;
pid1 = arguments[0];
prior = int.Parse(arguments[1]);
This Gives me the Priority and ProjectID of the Row in which I clicked the button.
How can I get the Priority and Project of the Row below this ?
The Rows are in the repeater control.
Change your
CommandArgumentto<%# Container.ItemIndex %>.Then in your
Clickedevent, you can do something like:Alternatively you can bind the priority and project ID to hidden fields in the repeater, and use
yourRepeater.Items[selectIndex].FindControl('yourHiddenFieldId').Textor similar.