Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to programmatically clear Checkbox
Message
From
28/04/2008 15:45:18
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
How to programmatically clear Checkbox
Miscellaneous
Thread ID:
01313608
Message ID:
01313608
Views:
67
Given the following HTML fragment, how can I clear the checkmark, in the checkbox with id = "checkAll", in code behind? I can get e reference to the containing grid with:
DirectCast(Page.FindControl("dgListItems"), DataGrid)
but I can't figure out how to get a reference to the checkbox in the HeaderTemplate in the ColumnTemplate.
<td><asp:datagrid id="dgListItems" runat="server" CssClass="labelText" Width="100%" OnSortCommand="dgListItems_HeaderSort"
                                        AllowSorting="True" AutoGenerateColumns="False" PageSize="12" AllowPaging="True">
                                        <AlternatingItemStyle CssClass="gridAlternateItem"></AlternatingItemStyle>
                                        <ItemStyle CssClass="gridLabelText"></ItemStyle>
                                        <HeaderStyle CssClass="gridHeader"></HeaderStyle>
                                        <Columns>
                                            <asp:TemplateColumn ItemStyle-HorizontalAlign="Center">
                                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                                <HeaderTemplate>
                                                    <asp:Label ID="lblAll" Runat="server" EnableViewState="False" CssClass="labeltext" ForeColor="Black">All</asp:Label>
                                                    <asp:CheckBox id="checkAll" Runat="server" OnCheckedChanged="CheckAll" AutoPostBack="True"></asp:CheckBox><br>
                                                    <br>
                                                </HeaderTemplate>
Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform