I've created a Gridview control that pulls some data from my database, but doesn't display all of the information I'm hoping it gathers. I choose not to display the primary key for user interface purposes, but require that key for basic operations on the grid.
I'm currently attempting to add a "Delete" option to the table, but unfortunately I'm having very little luck. Here's my .aspx file.
<asp:GridView ID="ManagerList_GV" runat="server"
AutoGenerateColumns="False" AllowSorting="True"
DataKeyNames = "ManagerID" OnRowEditing="editManager"
OnRowDataBound="FormatManagers" CellPadding="3" >
<Columns>
<asp:BoundField HeaderText="Manager" DataField="FullName" />
<asp:BoundField HeaderText="Status" DataField="Status" />
<asp:CommandField EditText="Edit" ShowEditButton="True" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton Text="Delete" runat="server" CommandName="deleteRow" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Unfortunately, I'm not sure what to do for my back-end. I've created my stored procedure and business layer subroutine, but I'm not sure how to a) pull in which row was just clicked and then b) access the primary key with respect to this row, since I'm not displaying it (the primary key is ManagerID).
Thanks in advance for your help :)