<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CheckBoxList Select All or None Checkboxes</title>
	<atom:link href="http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/</link>
	<description>News, Tutorials and Codesnippets about C#, ASP.NET- Silverlight</description>
	<lastBuildDate>Tue, 05 Jul 2011 10:02:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: mohan</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-155453</link>
		<dc:creator>mohan</dc:creator>
		<pubDate>Thu, 26 Feb 2009 07:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-155453</guid>
		<description>nothing understand</description>
		<content:encoded><![CDATA[<p>nothing understand</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Queena</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-136140</link>
		<dc:creator>Queena</dc:creator>
		<pubDate>Wed, 12 Nov 2008 10:45:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-136140</guid>
		<description>if i want to use this control to certain checkboxlist. how should i do?  that means, there is a checkbox_A and a item called &quot;delete all&quot;. if &quot; deleter all&quot; is selected, the all items beside itself would been enabled. how should i do? thx~</description>
		<content:encoded><![CDATA[<p>if i want to use this control to certain checkboxlist. how should i do?  that means, there is a checkbox_A and a item called &#8220;delete all&#8221;. if &#8221; deleter all&#8221; is selected, the all items beside itself would been enabled. how should i do? thx~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randi</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-108835</link>
		<dc:creator>Randi</dc:creator>
		<pubDate>Fri, 13 Jun 2008 18:11:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-108835</guid>
		<description>If you&#039;re doing in with ASP.net and want to do it in the code behind..
in the asp, set &quot;OnSelectedIndexChanged&quot; to the method name you want, in mine it&#039;s &quot;checkboxClicked&quot;.
Then, make sure AutoPostBack is set to true. This makes sure that the check boxes are refreshed everytime it&#039;s clicked.

say you have a list item named &quot;Select All&quot; and a list item named &quot;Select None&quot;.
you check list is called &quot;chklst&quot;

here is your method:

public void comboClicked(Object sender, EventArgs e)
{
    for (int i = 0; i &lt; chklst.Items.Count; i++)
    {
          ///this says &#039;if select none is selected and the box you&#039;re on isn&#039;t the select none box, set the selected to false.
          if(chklst.Items.FindByText(&quot;Select None&quot;).Selected == true &amp;&amp; chklst.Items[i] != chklst.Items.FindByText(&quot;Select None&quot;))
     {
                chklst.Items[i].Selected = false;
     }

    if(chklst.Items.FindByText(&quot;Select All&quot;.Selected == true)
   {
              chklst.Items[i].Selected = true;
    }

}</description>
		<content:encoded><![CDATA[<p>If you&#8217;re doing in with ASP.net and want to do it in the code behind..<br />
in the asp, set &#8220;OnSelectedIndexChanged&#8221; to the method name you want, in mine it&#8217;s &#8220;checkboxClicked&#8221;.<br />
Then, make sure AutoPostBack is set to true. This makes sure that the check boxes are refreshed everytime it&#8217;s clicked.</p>
<p>say you have a list item named &#8220;Select All&#8221; and a list item named &#8220;Select None&#8221;.<br />
you check list is called &#8220;chklst&#8221;</p>
<p>here is your method:</p>
<p>public void comboClicked(Object sender, EventArgs e)<br />
{<br />
    for (int i = 0; i &lt; chklst.Items.Count; i++)<br />
    {<br />
          ///this says &#8216;if select none is selected and the box you&#8217;re on isn&#8217;t the select none box, set the selected to false.<br />
          if(chklst.Items.FindByText(&#8220;Select None&#8221;).Selected == true &amp;&amp; chklst.Items[i] != chklst.Items.FindByText(&#8220;Select None&#8221;))<br />
     {<br />
                chklst.Items[i].Selected = false;<br />
     }</p>
<p>    if(chklst.Items.FindByText(&#8220;Select All&#8221;.Selected == true)<br />
   {<br />
              chklst.Items[i].Selected = true;<br />
    }</p>
<p>}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: katerina</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-97541</link>
		<dc:creator>katerina</dc:creator>
		<pubDate>Tue, 22 Apr 2008 01:20:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-97541</guid>
		<description>Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Thomson</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-59647</link>
		<dc:creator>Simon Thomson</dc:creator>
		<pubDate>Mon, 29 Oct 2007 12:52:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-59647</guid>
		<description>Thanks for the script. I had to remove the &#039;return false&#039; part as it stopped after the first checkbox! I also notice that you are using â€™checkboxâ€™ which has to be converted to &#039;checkbox&#039; (different quotes)</description>
		<content:encoded><![CDATA[<p>Thanks for the script. I had to remove the &#8216;return false&#8217; part as it stopped after the first checkbox! I also notice that you are using â€™checkboxâ€™ which has to be converted to &#8216;checkbox&#8217; (different quotes)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yanna</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-45545</link>
		<dc:creator>Yanna</dc:creator>
		<pubDate>Fri, 10 Aug 2007 13:38:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-45545</guid>
		<description>Thank you so much for your prompt response! I&#039;ll give it a try!</description>
		<content:encoded><![CDATA[<p>Thank you so much for your prompt response! I&#8217;ll give it a try!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andreas.kraus</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-45534</link>
		<dc:creator>andreas.kraus</dc:creator>
		<pubDate>Fri, 10 Aug 2007 11:27:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-45534</guid>
		<description>Hi Yanna,

define a ContentPlaceHolder within the head tag of your MasterPage and add the script on the particular .aspx site to that ContentPlaceHolder.

Another way would be to add it via  this.Header.Controls.Add(); in Codebehind.

hth</description>
		<content:encoded><![CDATA[<p>Hi Yanna,</p>
<p>define a ContentPlaceHolder within the head tag of your MasterPage and add the script on the particular .aspx site to that ContentPlaceHolder.</p>
<p>Another way would be to add it via  this.Header.Controls.Add(); in Codebehind.</p>
<p>hth</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yanna</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-45532</link>
		<dc:creator>Yanna</dc:creator>
		<pubDate>Fri, 10 Aug 2007 11:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-45532</guid>
		<description>Correction: I use master pages. Where would i put the script part?</description>
		<content:encoded><![CDATA[<p>Correction: I use master pages. Where would i put the script part?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dupls</title>
		<link>http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/comment-page-1/#comment-44289</link>
		<dc:creator>dupls</dc:creator>
		<pubDate>Wed, 01 Aug 2007 19:30:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.andreas-kraus.net/blog/checkboxlist-select-all-or-none-checkboxes/#comment-44289</guid>
		<description>I have several checkBox &#039;s on a page and only want to have a checkall box on a check uncheck on a group of them. I&#039;ve made a validataiongroup of the ones I want to have this feature but don&#039;t know how to set the code in place for it to work.</description>
		<content:encoded><![CDATA[<p>I have several checkBox &#8216;s on a page and only want to have a checkall box on a check uncheck on a group of them. I&#8217;ve made a validataiongroup of the ones I want to have this feature but don&#8217;t know how to set the code in place for it to work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

