Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to programmatically clear Checkbox
Message
 
 
To
28/04/2008 15:45:18
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01313608
Message ID:
01313626
Views:
6
Hi Bruce,

This is not the direct answer to your question, but check out this great control by Dino Esposito

http://msdn2.microsoft.com/en-us/magazine/cc163612.aspx

I was thinking of incorporating it into my own page too. The only difference is that I need the field to be bound (in my case I need to use Approved checkbox and bound it to the table). I haven't yet read the article too close to see, if it fits exactly my purpose...

>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
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform