Hi Guys,
I'm trying to use images representing arrows to allow the user to change the order in which items appear in a list in a grid view in ASP.NET.
I have a class which has a value named "position", the class is displayed inside the GridView and is ordered by position. In each of the rows of the gridview are an up and down arrow which i want to change the value of "position" for the object represent by the row of the gridview. Whats the easiest way to do this?
ASP -
<br /><strong>Previous Employment: </strong> <br />
Pick one of your previous employers listed below to update/delete or <asp:HyperLink ID="PreviousEmploymentLink" runat="server" />.
<asp:GridView runat="server" ID="EmploymentDataGrid" AutoGenerateColumns="false" OnRowDeleting="EmploymentDataGrid_onDeleting"
DataKeyNames="EmployerId" SkinID="FullWidthGrid" >
<EmptyDataTemplate>
<p>No Previous Employment added yet</p>
</EmptyDataTemplate>
<Columns>
<asp:BoundField HeaderText="Dates" DataField="Dates" />
<asp:BoundField HeaderText="Employer's Name" DataField="EmployerName" />
<asp:BoundField HeaderText="Job Description" DataField="JobDescription" />
<asp:BoundField HeaderText="Job Title" DataField="JobTitle" />
<asp:HyperLinkField HeaderStyle-Width="30px" DataNavigateUrlFields="EmployerId"
HeaderText="Edit" Text="<img src='../../../Images/edit.gif' alt='Edit Employment' border='0'/>"
DataNavigateUrlFormatString="UpdatePreviousEmployment.aspx?PreviousEmploymentId={0}" />
<asp:TemplateField HeaderText="Delete" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="45px">
<ItemTemplate>
<asp:ImageButton AlternateText="Delete User" ID="DeleteButton" runat="server" CommandName="Delete" ImageUrl="~/Images/delete.gif" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Position" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="45px">
<ItemTemplate>
<asp:ImageButton AlternateText="Move Up" ID="UpPositionButton" runat="server" CommandName="MoveEmploymentUp" OnClick="MoveEmploymentUp" ImageUrl="~/Images/arrow_up_green.gif" />
<asp:ImageButton AlternateText="Move Down" ID="DownPositionButton" runat="server" CommandName="MoveEmploymentDown" ImageUrl="~/Images/arrow_down_green.gif" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Thanks!