I have a column in a datagrid that displays a checkbox when its not in edit mode. It edit mode it displays Accept and Cancel links. When the user clicks the Accept link it should trigger the OnUpdateCommand. But when I step through the code-behind it simply executes the Page_Load method and exits. It never gets to the Update method.
This is where I declare the methods to call for the different commands:
This is my templateColumn:
Please help me to figure out what I'm doing wrong. I've been having this problem for over a day now and I'm working on tight deadlines. Any suggestions or clues would be greatly appreciated.
Thanks in advance,
- VB Rookie
This is where I declare the methods to call for the different commands:
Code:
<asp:DataGrid id="dataGridTopLevelMenu" runat="server" HorizontalAlign="Center" CellPadding="3" CellSpacing="1" WIDTH="100%" BorderWidth="0" BorderColor="" AutoGenerateColumns="false" GridLines="Both" OnEditCommand="dataGridTopLevelMenu_Edit" OnCancelCommand="dataGridTopLevelMenu_Cancel" OnUpdateCommand="dataGridTopLevelMenu_Update" OnItemCommand="dataGridTopLevelMenu_ItemCommand">
This is my templateColumn:
Code:
<asp:TemplateColumn ItemStyle-CssClass="style" ItemStyle-Wrap="False" HeaderStyle-CssClass="td_Style_01" HeaderText="X">
<ItemTemplate>
<asp:CheckBox runat="server" ID="chkDelete" checked='<%#DataBinder.Eval (Container.DataItem, "delete")%>'>
</asp:CheckBox>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton CommandName="Update" Text="Accept" Runat="server" ID="lnkUpdate" />
<BR />
<asp:LinkButton CommandName="Cancel" Text="Cancel" CausesValidation="false" Runat="server" ID="lnkCancel" />
</EditItemTemplate>
</asp:TemplateColumn>
Please help me to figure out what I'm doing wrong. I've been having this problem for over a day now and I'm working on tight deadlines. Any suggestions or clues would be greatly appreciated.
Thanks in advance,
- VB Rookie