T
tshad
I am trying to find a way to access a checkbox after the Cancel button is
pressed during inline editing of a GridView.
<asp:TemplateField HeaderText="Reviewed"
ItemStyle-CssClass="alignCenter" SortExpression="Reviewed" Visible="True">
<ItemTemplate >
<asp:CheckBox ID="chkReviewed" runat="server"
OnCheckedChanged="chkReviewed_CheckChanged"
AutoPostBack="True"/></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lblReviewed" runat="server" Text='<%# Eval("Reviewed")
== DBNull.Value ? "No" : Convert.ToBoolean(Eval("Reviewed")) ? "Yes" : "No"
%>'></asp:Label>
</EditItemTemplate>
</asp:TemplateField>
The problem is that if the chkReviewed is not checked, it will not be
checked if the user pressed the Canel button after editing the line.
I need to set the checkBox regardless of whether the user pressed the Update
or the Cancel button.
I tried the onCancelingEdit event, but it only allows me access to the
objects that were on the row during editing. In this case, that would be
the lblReviewed object and not the chkReviewed object.
Is there a way to know which row was edited during cancellation that would
give me access to the chkReviewed button before it is displayed so I can
check it?
Thanks,
Tom
pressed during inline editing of a GridView.
<asp:TemplateField HeaderText="Reviewed"
ItemStyle-CssClass="alignCenter" SortExpression="Reviewed" Visible="True">
<ItemTemplate >
<asp:CheckBox ID="chkReviewed" runat="server"
OnCheckedChanged="chkReviewed_CheckChanged"
AutoPostBack="True"/></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lblReviewed" runat="server" Text='<%# Eval("Reviewed")
== DBNull.Value ? "No" : Convert.ToBoolean(Eval("Reviewed")) ? "Yes" : "No"
%>'></asp:Label>
</EditItemTemplate>
</asp:TemplateField>
The problem is that if the chkReviewed is not checked, it will not be
checked if the user pressed the Canel button after editing the line.
I need to set the checkBox regardless of whether the user pressed the Update
or the Cancel button.
I tried the onCancelingEdit event, but it only allows me access to the
objects that were on the row during editing. In this case, that would be
the lblReviewed object and not the chkReviewed object.
Is there a way to know which row was edited during cancellation that would
give me access to the chkReviewed button before it is displayed so I can
check it?
Thanks,
Tom