<?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: 3-State CheckBox using Microsoft AJAX</title>
	<atom:link href="http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/</link>
	<description>It&#039;s always time to upgrade!</description>
	<lastBuildDate>Thu, 15 Jul 2010 04:53:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Chad</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-1170</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Thu, 01 Jul 2010 14:26:41 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-1170</guid>
		<description>[DefaultValue(CheckedState.Blank)]
[Bindable(true, BindingDirection.TwoWay)]
[Themeable(false)]
public bool? IsChecked
{
	#region IsChecked

	get
	{
		switch (Checked)
		{
			case CheckedState.Checked: return true;
			case CheckedState.Unchecked: return false;
			case CheckedState.Blank:
			default: return null;
		}
	}
	set
	{
		Checked = value == null ? CheckedState.Blank : value.Value ? CheckedState.Checked : CheckedState.Unchecked;
	}

	#endregion
}</description>
		<content:encoded><![CDATA[<p>[DefaultValue(CheckedState.Blank)]<br />
[Bindable(true, BindingDirection.TwoWay)]<br />
[Themeable(false)]<br />
public bool? IsChecked<br />
{<br />
	#region IsChecked</p>
<p>	get<br />
	{<br />
		switch (Checked)<br />
		{<br />
			case CheckedState.Checked: return true;<br />
			case CheckedState.Unchecked: return false;<br />
			case CheckedState.Blank:<br />
			default: return null;<br />
		}<br />
	}<br />
	set<br />
	{<br />
		Checked = value == null ? CheckedState.Blank : value.Value ? CheckedState.Checked : CheckedState.Unchecked;<br />
	}</p>
<p>	#endregion<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-1159</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Thu, 01 Jul 2010 01:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-1159</guid>
		<description>You could easily add a Text property to the control, sure. I would add a Label control positioned relative to the image button, setting the target control Id = the image button&#039;s ID. This way the lable will act like a true form label, similar to how ASP.NET renders a true asp:CheckBox control.

As far as setting the 3-way state using a nullable boolean value, that should be easy as well. Something like this should suffice; (where myBitField is a nullable boolean, (bool? myBitField)):

myCheckBox.Checked = myBitField == null ? CheckedState.Blank : myBitField.Value ? CheckedState.Checked : CheckedState.Unchecked;

And then just reversing that the other way to get the value back out. You could also scrap the enumeration and simply use a Nullable property instead, blank = null, checked = true, unchecked = false. It should be fairly simple to switch the binding from the enumeration with the hidden field (which can have a blank string as its value anyway).

Thanks,
Chad</description>
		<content:encoded><![CDATA[<p>You could easily add a Text property to the control, sure. I would add a Label control positioned relative to the image button, setting the target control Id = the image button&#8217;s ID. This way the lable will act like a true form label, similar to how ASP.NET renders a true asp:CheckBox control.</p>
<p>As far as setting the 3-way state using a nullable boolean value, that should be easy as well. Something like this should suffice; (where myBitField is a nullable boolean, (bool? myBitField)):</p>
<p>myCheckBox.Checked = myBitField == null ? CheckedState.Blank : myBitField.Value ? CheckedState.Checked : CheckedState.Unchecked;</p>
<p>And then just reversing that the other way to get the value back out. You could also scrap the enumeration and simply use a Nullable property instead, blank = null, checked = true, unchecked = false. It should be fairly simple to switch the binding from the enumeration with the hidden field (which can have a blank string as its value anyway).</p>
<p>Thanks,<br />
Chad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-1045</link>
		<dc:creator>George</dc:creator>
		<pubDate>Mon, 21 Jun 2010 04:33:59 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-1045</guid>
		<description>I like your control, but I&#039;m missing the &quot;Text&quot; property. Also I need to bind to a nullable boolean database field (sql &#039;bit&#039; type, actually). Expected behavior would be to bind NULL to the third, &#039;Blank&#039; state. Is it easy task?

rgds, George</description>
		<content:encoded><![CDATA[<p>I like your control, but I&#8217;m missing the &#8220;Text&#8221; property. Also I need to bind to a nullable boolean database field (sql &#8216;bit&#8217; type, actually). Expected behavior would be to bind NULL to the third, &#8216;Blank&#8217; state. Is it easy task?</p>
<p>rgds, George</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-479</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Sun, 14 Mar 2010 14:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-479</guid>
		<description>Were you wanting to use an UpdatePanel for your partial post-back or client-side page call-back? If you want to force a post-back, and the control is within an UpdatePanel, this is pretty simple, there are several great suggestions on this forum post in reply to a similar question: http://forums.asp.net/t/1034652.aspx.</description>
		<content:encoded><![CDATA[<p>Were you wanting to use an UpdatePanel for your partial post-back or client-side page call-back? If you want to force a post-back, and the control is within an UpdatePanel, this is pretty simple, there are several great suggestions on this forum post in reply to a similar question: <a href="http://forums.asp.net/t/1034652.aspx" rel="nofollow">http://forums.asp.net/t/1034652.aspx</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-421</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Fri, 05 Feb 2010 15:29:52 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-421</guid>
		<description>Nice work Chad. I have implemented this as-is and it works great. One question though. I would like to use a partial page post-back when the state changes on the client. How do I go about wiring the client-side events and capturing them on the server-side?

Thanks for a great control!

josh</description>
		<content:encoded><![CDATA[<p>Nice work Chad. I have implemented this as-is and it works great. One question though. I would like to use a partial page post-back when the state changes on the client. How do I go about wiring the client-side events and capturing them on the server-side?</p>
<p>Thanks for a great control!</p>
<p>josh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nulled Scripts</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-376</link>
		<dc:creator>Nulled Scripts</dc:creator>
		<pubDate>Tue, 22 Dec 2009 21:59:57 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-376</guid>
		<description>Nice post..Keep them coming :) Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Nice post..Keep them coming <img src='http://www.chadscharf.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nulled Scripts</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-375</link>
		<dc:creator>Nulled Scripts</dc:creator>
		<pubDate>Tue, 22 Dec 2009 21:31:33 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-375</guid>
		<description>Excellent post..Keep them coming :) Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Excellent post..Keep them coming <img src='http://www.chadscharf.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Dennis</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-250</link>
		<dc:creator>Robert Dennis</dc:creator>
		<pubDate>Wed, 07 Oct 2009 20:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-250</guid>
		<description>Nice work.  I would have gone with yes (check), no (blank), and don&#039;t care (gray), vs. yes, inherit(blank), and no(x). 
I would also add another state, partial, for using where you have a list and one child is checked.</description>
		<content:encoded><![CDATA[<p>Nice work.  I would have gone with yes (check), no (blank), and don&#8217;t care (gray), vs. yes, inherit(blank), and no(x).<br />
I would also add another state, partial, for using where you have a list and one child is checked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-169</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Fri, 11 Sep 2009 04:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-169</guid>
		<description>William,

Glad to hear you like the control. I&#039;ve not personally tried to place this control in a databound control like a DataGrid, GridView or any 3rd party grids such as ComponentArt or Infragistics, although I love these control libraries personally.

Basically the principles are all the same for these controls. They have one or more ITemplate containers that house a group of child controls that get created during data binding at run-time.

I&#039;ve implmented the INamingContainer interface for the 3-state check-box which should allow it to easily be placed into other naming containers or data bound controls such as DataGrids or Repeaters, etc.

My suggestion would be to try it out in a simple Repeater control. If it works in there, step it up until you reach a more complex grid control such as the one you&#039;re using from ComponentArt. If it doesn&#039;t work in the Repeater then there is an issue with my implementation of INamingContainer or the ScriptManager reference(s).

I&#039;ll take a look at it later this week and try it in several data bound repeating controls and see what I can turn up.

Thanks again for the feedback!

~ Chad</description>
		<content:encoded><![CDATA[<p>William,</p>
<p>Glad to hear you like the control. I&#8217;ve not personally tried to place this control in a databound control like a DataGrid, GridView or any 3rd party grids such as ComponentArt or Infragistics, although I love these control libraries personally.</p>
<p>Basically the principles are all the same for these controls. They have one or more ITemplate containers that house a group of child controls that get created during data binding at run-time.</p>
<p>I&#8217;ve implmented the INamingContainer interface for the 3-state check-box which should allow it to easily be placed into other naming containers or data bound controls such as DataGrids or Repeaters, etc.</p>
<p>My suggestion would be to try it out in a simple Repeater control. If it works in there, step it up until you reach a more complex grid control such as the one you&#8217;re using from ComponentArt. If it doesn&#8217;t work in the Repeater then there is an issue with my implementation of INamingContainer or the ScriptManager reference(s).</p>
<p>I&#8217;ll take a look at it later this week and try it in several data bound repeating controls and see what I can turn up.</p>
<p>Thanks again for the feedback!</p>
<p>~ Chad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://www.chadscharf.com/index.php/2008/10/3-state-checkbox-using-microsoft-ajax/comment-page-1/#comment-167</link>
		<dc:creator>William</dc:creator>
		<pubDate>Tue, 08 Sep 2009 16:59:37 +0000</pubDate>
		<guid isPermaLink="false">http://chadscharf.com/post.aspx?id=565b0d14-08af-4b2d-8677-11163000d088#comment-167</guid>
		<description>Hi Chad, terrific your web control.
Excuse me may be you can say how put this control in a datagrid...
I put it into a ComponentArt Datagrid and this control isn&#039;t visible...

Thanks...</description>
		<content:encoded><![CDATA[<p>Hi Chad, terrific your web control.<br />
Excuse me may be you can say how put this control in a datagrid&#8230;<br />
I put it into a ComponentArt Datagrid and this control isn&#8217;t visible&#8230;</p>
<p>Thanks&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
