The ASPCodeExtender CheckboxController

What is it?

This Microsoft Ajax for ASP.NET extender control lets you easily create a "Select all/delselect all" parent checkbox to automatically set the checked state of other checkboxes.

 

 

Please check out the CheckboxController demo

The cool things about it is that it

  • works in templated controls (repeaters etc)
  • lets you set an associated text and have it automatically change (i.e from "Select all" to "Deselect all" or whatever) depending on state
  • works both ways. I.e when you select the "last" of a child checkbox (and by that making all child checkboxes checked) it turns the parent checkbox to selected (and changes the associated label as well)

Usage

Limitations 

I am not so proud over the behaviour javascript code. I was in a hurry - but  wanted to open up for the possibility to use another control (for example a linkbutton or div or plain span) as a controller. I have gotten a bit on the way but not complete - therefore it might look like the CheckboxControllerCheckbox is never of any use.

The download

Please note that the download does NOT include the AjaxControlToolkit.dll. You will ned to download and install it separately from http://www.ajaxandasp.net/a-1/Ajax-Control-Toolkit.aspx

Attachments

  aspcodeextenders.zip

Comments (add)»

  1. dylan barber said,

    Friday, May 04, 2007 7:37 AM

    The article is good but seems to be outdated - i cant get it to work and dont understand the extenders enough to even start figuring it out yet.