<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>CSS Friendly Control Adapters</title><link>http://forums.asp.net/1018.aspx</link><description>Discuss the CSS Friendly Control Adapters sample project, ask questions, post bugs, etc</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/2304437.aspx</link><pubDate>Thu, 17 Apr 2008 14:51:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2304437</guid><dc:creator>muybn</dc:creator><author>muybn</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2304437.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=2304437</wfw:commentRss><description>&lt;p&gt;What if, after installing the adapters, the CSS Friendly Adapter option doesn&amp;#39;t show up on my new website menu?&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1805762.aspx</link><pubDate>Mon, 16 Jul 2007 14:50:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1805762</guid><dc:creator>ahsteele</dc:creator><author>ahsteele</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1805762.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1805762</wfw:commentRss><description>&lt;p&gt;Sorry for the delayed I was out of town for the weekend (some sort of out of office on a forum would be nice).&amp;nbsp; At any rate, you are correct w/o the adapters it does hit as many times.&amp;nbsp; Honestly, when I began having the problem and started a search for a solution this was the first thread that I found that seemed to describe my problem.&amp;nbsp; Color me embarassed and I am sorry for wasting yours and other people&amp;#39;s time on this issue.&amp;nbsp; Thank you for all of the help.&lt;/p&gt;
&lt;p&gt;Now, I am off&amp;nbsp;to figure out how to build my DataTable based on the multiple calls to the method.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1801342.aspx</link><pubDate>Thu, 12 Jul 2007 23:15:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1801342</guid><dc:creator>Russ Helfand</dc:creator><author>Russ Helfand</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1801342.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1801342</wfw:commentRss><description>&lt;p&gt;Andrew, have you tried your debugging test without the adapters installed. I did and I found that I hit that break point as many times as I have items checked... even when I&amp;#39;m not using the adapters. Doesn&amp;#39;t that mean that that is the intended behavior in the framework?&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1801149.aspx</link><pubDate>Thu, 12 Jul 2007 20:20:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1801149</guid><dc:creator>ahsteele</dc:creator><author>ahsteele</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1801149.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1801149</wfw:commentRss><description>&lt;p&gt;Steps followed:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Installed Visual Web Developer on my laptop (seperate machine from my development box)&lt;/li&gt;
&lt;li&gt;Installed the VSI file &lt;a href="http://www.asp.net/cssadapters"&gt;&lt;font color="#034efa"&gt;http://www.asp.net/cssadapters&lt;/font&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Created a new page utilizing the code above&lt;/li&gt;
&lt;li&gt;Ran the page got the number three to show up&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Here&amp;#39;s the problem I have always been able to get the number to count to 3, but it calls the TreeView1_TreeNodeCheckChanged method repeatedly.&amp;nbsp; If you put a breakpoint at line 15 the open { of the TreeView1_TreeNodeCheckChanged method you&amp;#39;ll see that you hit it three times.&amp;nbsp; If you check the value of the TreeView1.CheckedNodes.Count you&amp;#39;ll see that it is equivalent to the times that the method has been called.&amp;nbsp; First pass it is one, second two, so on and so forth.&amp;nbsp; Do have similar results when you add the breakpoint?&lt;/p&gt;
&lt;p&gt;This is not a huge issue in this particular situation in that we want to output what was checked, but don&amp;#39;t want to put any other logic behind it.&amp;nbsp; For my more complex purposes I intend to build a DataTable based on the selected nodes and then insert that information into&amp;nbsp;a database.&amp;nbsp; It is my itention to present a user with a list of options which they can select from and then insert only the checked ones.&amp;nbsp; With the repeated calling of the TreeView1_TreeNodeCheckChanged method I get a call to the database for each checked node vs. the single call for the entire TreeView containing all checked nodes that I expected.&amp;nbsp; Am I simply misunderstanding how the OnTreeNodeCheckChanged event works?&lt;/p&gt;
&lt;p&gt;I have restarted my web app on the dev server.&amp;nbsp; I don&amp;#39;t know how to flush the cache for Visual Studio.&amp;nbsp; I really apprecaite all of the help.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1800550.aspx</link><pubDate>Thu, 12 Jul 2007 15:21:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1800550</guid><dc:creator>Falcon</dc:creator><author>Falcon</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1800550.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1800550</wfw:commentRss><description>&lt;p&gt;Another possibility is that you&amp;#39;re running into a bizarre Visual Studio caching problem. They seem to come up from time to time and make things behave strangely. I&amp;#39;m not sure what your testing setup is like, but your server and/or Visual Studio may be using a cached version of the adapters even though you updated the code.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1800335.aspx</link><pubDate>Thu, 12 Jul 2007 13:26:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1800335</guid><dc:creator>Russ Helfand</dc:creator><author>Russ Helfand</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1800335.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1800335</wfw:commentRss><description>&lt;p&gt;Hi Andrew, I tried a small experiment. It seemed to show that things were working OK so I&amp;#39;m again suspecting that you are somehow using a really old version of the code. Here&amp;#39;s what I did and what you might want to try yourself...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Visit &lt;a href="http://www.asp.net/cssadapters"&gt;http://www.asp.net/cssadapters&lt;/a&gt; and download the VSI for the adapter kit. Install it per the instructions at &lt;a href="http://www.asp.net/cssadapters/walkthru/walkthrough.aspx#DownloadAndInstall"&gt;http://www.asp.net/cssadapters/walkthru/walkthrough.aspx#DownloadAndInstall&lt;/a&gt;.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Create a new web site in Visual Web Developer Express (VWD, the free web version of VS). Base that site on the ASP.NET 2.0 CSS Friendly Website template that you see in the &amp;quot;new web site dialog.&amp;quot;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Create a new page (with codebehind) called test.aspx (and test.aspx.cs). See my markup/code below.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Run the page with or without debug. Check any of the 3 checkboxes and hit the button to submit the form. I see the correct number show up on the page to report how many times TreeView1_TreeNodeCheckChanged was called. If I check 2 boxes then I get the number 2 shown on the page.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Isn&amp;#39;t this working as you would expect?&lt;/p&gt;
&lt;p&gt;Here is my markup and code for the test page. It is entirely based on the markup/code you posted higher up in this thread.&lt;/p&gt;
&lt;p&gt;Please let me know your results. &lt;/p&gt;
&lt;p&gt;Best regards, Russ&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeFile=&amp;quot;test.aspx.cs&amp;quot; Inherits=&amp;quot;test&amp;quot; %&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;&lt;a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&lt;/a&gt;&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;html xmlns=&amp;quot;&lt;a href="http://www.w3.org/1999/xhtml"&gt;http://www.w3.org/1999/xhtml&lt;/a&gt;&amp;quot; &amp;gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Test&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:TreeView ID=&amp;quot;TreeView1&amp;quot; runat=&amp;quot;server&amp;quot; OnAdaptedTreeNodeCheckChanged=&amp;quot;TreeView1_TreeNodeCheckChanged&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Nodes&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:TreeNode Text=&amp;quot;test1&amp;quot; Value=&amp;quot;test1&amp;quot; ShowCheckBox=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:TreeNode Text=&amp;quot;test2&amp;quot; Value=&amp;quot;test2&amp;quot; ShowCheckBox=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:TreeNode Text=&amp;quot;test3&amp;quot; Value=&amp;quot;test3&amp;quot; ShowCheckBox=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Nodes&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:TreeView&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Label runat=&amp;quot;server&amp;quot; ID=&amp;quot;myCount&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID=&amp;quot;Button1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Button&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;/p&gt;
&lt;p&gt;public partial class test : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void TreeView1_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; myCount.Text = TreeView1.CheckedNodes.Count.ToString();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1799153.aspx</link><pubDate>Wed, 11 Jul 2007 23:49:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1799153</guid><dc:creator>ahsteele</dc:creator><author>ahsteele</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1799153.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1799153</wfw:commentRss><description>&lt;p&gt;Scratch that, the above only works if the last item in the TreeNodeCollection is checked.&amp;nbsp; Back to the drawing board.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1799139.aspx</link><pubDate>Wed, 11 Jul 2007 23:26:30 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1799139</guid><dc:creator>ahsteele</dc:creator><author>ahsteele</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1799139.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1799139</wfw:commentRss><description>&lt;p&gt;Just to be sure I started a new Web Project using the dll and browser files from &lt;a href="http://www.codeplex.com/cssfriendly"&gt;http://www.codeplex.com/cssfriendly&lt;/a&gt;.&amp;nbsp; I had the same problem.&amp;nbsp; I then downloaded the source files and placed those into yet another new Web Project.&amp;nbsp; I created a very simple TreeView with a very simple method to be called OnTreeNodeCheckChanged (code below).&amp;nbsp; The same problem occurred and also occurred in the provided examples.&lt;/p&gt;
&lt;p&gt;&lt;pre class="coloredcode"&gt;    &amp;lt;&lt;span class="tag"&gt;form&lt;/span&gt;&lt;span class="attr"&gt; id=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;form1&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class="tag"&gt;div&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;asp:TreeView&lt;/span&gt;&lt;span class="attr"&gt; ID=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;TreeView1&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; OnAdaptedTreeNodeCheckChanged=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;TreeView1_TreeNodeCheckChanged&amp;quot;&lt;/span&gt;&amp;gt;
          &amp;lt;&lt;span class="tag"&gt;Nodes&lt;/span&gt;&amp;gt;
            &amp;lt;&lt;span class="tag"&gt;asp:TreeNode&lt;/span&gt;&lt;span class="attr"&gt; Text=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;test1&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Value=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;test1&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; ShowCheckBox=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;
            &amp;lt;&lt;span class="tag"&gt;asp:TreeNode&lt;/span&gt;&lt;span class="attr"&gt; Text=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;test2&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Value=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;test2&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; ShowCheckBox=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;
            &amp;lt;&lt;span class="tag"&gt;asp:TreeNode&lt;/span&gt;&lt;span class="attr"&gt; Text=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;test3&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Value=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;test3&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; ShowCheckBox=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;
          &amp;lt;/&lt;span class="tag"&gt;Nodes&lt;/span&gt;&amp;gt;
        &amp;lt;/&lt;span class="tag"&gt;asp:TreeView&lt;/span&gt;&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;asp:Label&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; ID=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;myCount&amp;quot;&lt;/span&gt; /&amp;gt;&amp;lt;&lt;span class="tag"&gt;br&lt;/span&gt; /&amp;gt;
        &amp;lt;&lt;span class="tag"&gt;asp:Button&lt;/span&gt;&lt;span class="attr"&gt; ID=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Button1&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Text=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Button&amp;quot;&lt;/span&gt; /&amp;gt;
    &amp;lt;/&lt;span class="tag"&gt;div&lt;/span&gt;&amp;gt;
    &amp;lt;/&lt;span class="tag"&gt;form&lt;/span&gt;&amp;gt;&lt;/pre&gt;&amp;nbsp; 
&lt;p&gt;&lt;pre class="coloredcode"&gt;    &lt;span class="kwd"&gt;public void&lt;/span&gt; TreeView1_TreeNodeCheckChanged(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, TreeNodeEventArgs e)
    {
        myCount.Text = TreeView1.CheckedNodes.Count.ToString();
    }&lt;/pre&gt;
&lt;p&gt;In walking through how&amp;nbsp;my&amp;nbsp;TreeView1_TreeNodeCheckChanged method&amp;nbsp;was called upon&amp;nbsp;when OnTreeNodeCheckChanged event was raised I was able to determine to a degree why the method is being called multiple times.&amp;nbsp; In the TreeViewAdapter class there is a method called UpdateCheckmarks.&amp;nbsp; This method calls Extender.RaiseAdapterEvent foreach&amp;nbsp;TreeNode in the passed TreeNodeCollection&amp;nbsp;that is checked.&amp;nbsp; I changed the method by adding a check ensuring that _checkboxIndex was equal to the TreeNodeCollection.count&amp;nbsp;and only when it is calling the Extender.RaiseAdaptedEvent (meaning that Extender.RaiseAdaptedEvent is only called on the last iteration through the collection).&amp;nbsp; My change to the UpdateCheckmarks method is below (lines 15, 16, and 18 are new).&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;        &lt;span class="kwd"&gt;private void&lt;/span&gt; UpdateCheckmarks(TreeNodeCollection items)
&lt;b id="2"&gt;2    &lt;/b&gt;        {
&lt;b id="3"&gt;3    &lt;/b&gt;            TreeView treeView = Control &lt;span class="kwd"&gt;as&lt;/span&gt; TreeView;
&lt;b id="4"&gt;4    &lt;/b&gt;            &lt;span class="kwd"&gt;if&lt;/span&gt; ((treeView != &lt;span class="kwd"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (items != &lt;span class="kwd"&gt;null&lt;/span&gt;))
&lt;b id="5"&gt;5    &lt;/b&gt;            {
&lt;b id="6"&gt;6    &lt;/b&gt;                &lt;span class="kwd"&gt;foreach&lt;/span&gt; (TreeNode item &lt;span class="kwd"&gt;in&lt;/span&gt; items)
&lt;b id="7"&gt;7    &lt;/b&gt;                {
&lt;b id="8"&gt;8    &lt;/b&gt;                    &lt;span class="kwd"&gt;if&lt;/span&gt; (IsCheckbox(treeView, item))
&lt;b id="9"&gt;9    &lt;/b&gt;                    {
&lt;b id="10"&gt;10   &lt;/b&gt;                        &lt;span class="kwd"&gt;string&lt;/span&gt; name = treeView.UniqueID + &lt;span class="st"&gt;&amp;quot;n&amp;quot;&lt;/span&gt; + _checkboxIndex.ToString() + &lt;span class="st"&gt;&amp;quot;CheckBox&amp;quot;&lt;/span&gt;;
&lt;b id="11"&gt;11   &lt;/b&gt;                        &lt;span class="kwd"&gt;bool&lt;/span&gt; bIsNowChecked = (Page.Request.Form[name] != &lt;span class="kwd"&gt;null&lt;/span&gt;);
&lt;b id="12"&gt;12   &lt;/b&gt;                        &lt;span class="kwd"&gt;if&lt;/span&gt; (item.Checked != bIsNowChecked)
&lt;b id="13"&gt;13   &lt;/b&gt;                        {
&lt;b id="14"&gt;14   &lt;/b&gt;                            item.Checked = bIsNowChecked;
&lt;b id="15"&gt;15   &lt;/b&gt;                            &lt;span class="kwd"&gt;if&lt;/span&gt; (_checkboxIndex == items.Count)
&lt;b id="16"&gt;16   &lt;/b&gt;                            {
&lt;b id="17"&gt;17   &lt;/b&gt;                                Extender.RaiseAdaptedEvent(&lt;span class="st"&gt;&amp;quot;TreeNodeCheckChanged&amp;quot;&lt;/span&gt;, &lt;span class="kwd"&gt;new&lt;/span&gt; TreeNodeEventArgs(item));
&lt;b id="18"&gt;18   &lt;/b&gt;                            }
&lt;b id="19"&gt;19   &lt;/b&gt;                        }
&lt;b id="20"&gt;20   &lt;/b&gt;                        _checkboxIndex++;
&lt;b id="21"&gt;21   &lt;/b&gt;                    }
&lt;b id="22"&gt;22   &lt;/b&gt;
&lt;b id="23"&gt;23   &lt;/b&gt;                    &lt;span class="kwd"&gt;if&lt;/span&gt; (HasChildren(item))
&lt;b id="24"&gt;24   &lt;/b&gt;                    {
&lt;b id="25"&gt;25   &lt;/b&gt;                        UpdateCheckmarks(item.ChildNodes);
&lt;b id="26"&gt;26   &lt;/b&gt;                    }
&lt;b id="27"&gt;27   &lt;/b&gt;                }
&lt;b id="28"&gt;28   &lt;/b&gt;            }
&lt;b id="29"&gt;29   &lt;/b&gt;        }
&lt;/pre&gt;
&lt;p&gt;I realize this probably bastardizes something fundamental that is presently outside of my understanding, but it does fix the problem.&amp;nbsp; Assuming that I am right and I have violated a .Net core fundamental or something else fundamental to the adapters a little guidance would be greatly appreciated.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1796949.aspx</link><pubDate>Tue, 10 Jul 2007 23:26:35 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1796949</guid><dc:creator>ahsteele</dc:creator><author>ahsteele</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1796949.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1796949</wfw:commentRss><description>&lt;p&gt;I downloaded the CSSFriendly.dll and CSSFriendlyAdapters.browser files
from http://www.codeplex.com/cssfriendly.&amp;nbsp; I removed all references to
the previous adapters and added the appropriate reference to the
CSSFriendly.dll.&amp;nbsp; I am experiencing the same behavior as before in that I get a call for each node checked in the TreeView.&amp;nbsp; I&amp;#39;ve placed my code below in case I missed something obvious.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;  &amp;lt;&lt;span class="tag"&gt;asp:TreeView&lt;/span&gt;&lt;span class="attr"&gt; ID=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;HierarchyTreeView&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;
&lt;span class="attr"&gt;&lt;/span&gt;&lt;span class="attr"&gt;&lt;/span&gt;&lt;span class="attr"&gt;       OnAdaptedTreeNodeCheckChanged=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;HierarchyTreeView_OnTreeNodeCheckChanged&amp;quot;&lt;/span&gt;
&lt;span class="attr"&gt;       OnPreRender=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;HierarchyTreeView_PreRender&amp;quot;&lt;/span&gt; /&amp;gt;
  &amp;lt;&lt;span class="tag"&gt;asp:Button&lt;/span&gt;&lt;span class="attr"&gt; id=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Submit&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; Text=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Add Items to Cart&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; runat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class="attr"&gt; UseSubmitBehavior=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;    &lt;span class="kwd"&gt;public void&lt;/span&gt; HierarchyTreeView_OnTreeNodeCheckChanged(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, TreeNodeEventArgs e)
    {
        HierarchyTreeView.CheckedNodes.Count
    }&lt;/pre&gt;&amp;nbsp;&amp;nbsp;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1796780.aspx</link><pubDate>Tue, 10 Jul 2007 21:05:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1796780</guid><dc:creator>Russ Helfand</dc:creator><author>Russ Helfand</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1796780.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1796780</wfw:commentRss><description>&lt;p&gt;It sounds like you are using somewhat outdated versions of the adapters. The final version from Microsoft is what can be downloaded at &lt;a href="http://www.asp.net/cssadapters"&gt;http://www.asp.net/cssadapters&lt;/a&gt;. There is an even better version (with more fixes) at &lt;a href="http://www.codeplex.com/cssfriendly"&gt;http://www.codeplex.com/cssfriendly&lt;/a&gt;. Hope this helps...&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1796767.aspx</link><pubDate>Tue, 10 Jul 2007 20:56:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1796767</guid><dc:creator>ahsteele</dc:creator><author>ahsteele</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1796767.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1796767</wfw:commentRss><description>&lt;p&gt;Wish I had noticed this before so I could have skipped the double post.&amp;nbsp; The code from the other thread also dumps the label association for the check boxes.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1796740.aspx</link><pubDate>Tue, 10 Jul 2007 20:43:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1796740</guid><dc:creator>ahsteele</dc:creator><author>ahsteele</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1796740.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1796740</wfw:commentRss><description>&lt;p&gt;Russ I&amp;nbsp;am having this exact problem.&amp;nbsp; In trying to fix it I attempted using your rewritten TreeViewAadapter from 09-12-2006, 5:33 PM to no avail.&amp;nbsp; I believe that I am using the most recent rev of the adapters but, more than likely I am missing something very simple here.&amp;nbsp; Any help would be greatly appreciated.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1422051.aspx</link><pubDate>Sun, 08 Oct 2006 22:45:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1422051</guid><dc:creator>Russ Helfand</dc:creator><author>Russ Helfand</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1422051.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1422051</wfw:commentRss><description>&lt;p&gt;Just got back from the veggie garden and started digging into this... I have good news on several fronts.&lt;/p&gt;&lt;p&gt;First, and most immediately, I was able to duplicate the problem using Brian&amp;#39;s latest recipe.&amp;nbsp; The safest and most immediate fix for you is (happily) quite easy.&amp;nbsp; Go to this posting, &lt;a href="http://forums.asp.net/1/1397908/ShowThread.aspx"&gt;http://forums.asp.net/1/1397908/ShowThread.aspx&lt;/a&gt;.&amp;nbsp; Locate my posting 09-12-2006, 5:33 PM.&amp;nbsp; Cut-n-paste the&amp;nbsp;code I posted there to create a&amp;nbsp;version of the TreeViewAdapter.cs file in your site&amp;#39;s App_Code\Adapters.&amp;nbsp; (If you are using VB you may need to do a little conversion work.&amp;nbsp; There are some nice online converters but you still need to do some hand tweaking afterwards.&amp;nbsp; If you are using VB and are really stuck, let me know and I&amp;#39;ll try to help.)&lt;/p&gt;&lt;p&gt;Note that there are other ideas discussed on &lt;a href="http://forums.asp.net/1/1397908/ShowThread.aspx"&gt;http://forums.asp.net/1/1397908/ShowThread.aspx&lt;/a&gt;&amp;nbsp;that some of you might want to explore but getting them integrated isn&amp;#39;t as easy as the simple cut-n-paste recipe I just offered.&amp;nbsp; Still, there are some great ideas there from others in the community.&lt;/p&gt;&lt;p&gt;OK, the other piece of good news is that all of these fixes will be included in the next rev of the kit so what you&amp;#39;re struggling with now won&amp;#39;t last forever.&amp;nbsp; I apologize, though, for the immediate inconvenience. I&amp;#39;m working on other improvements to the TreeView adapter (like maintaining the true and complete expand/collapse state between postbacks) so your patience will be rewarded.&lt;/p&gt;&lt;p&gt;If the fix at &lt;a href="http://forums.asp.net/1/1397908/ShowThread.aspx"&gt;http://forums.asp.net/1/1397908/ShowThread.aspx&lt;/a&gt;&amp;nbsp;does not solve your problem (i.e., if you continue to see events being fired inappropriately and too often) let me know.&amp;nbsp; My testing locally showed that applying the fix in &lt;a href="http://forums.asp.net/1/1397908/ShowThread.aspx"&gt;http://forums.asp.net/1/1397908/ShowThread.aspx&lt;/a&gt;&amp;nbsp;made this problem (which I could repro prior to applying the fix) go away.&amp;nbsp; If your results vary from that... let me know.&lt;/p&gt;&lt;p&gt;Best regards,&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1421977.aspx</link><pubDate>Sun, 08 Oct 2006 19:39:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1421977</guid><dc:creator>brian.brown</dc:creator><author>brian.brown</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1421977.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1421977</wfw:commentRss><description>&lt;p&gt;It is very easy to reproduce the problem with the CheckChanged event firing for ever cheked node&amp;nbsp;on every postback.&amp;nbsp; Just add a button to the WalkThru/CheckboxTreeView.aspx provided in the adapter downloads.&amp;nbsp; Check a couple of the nodes and click the button.&amp;nbsp; You will see the checkchanged event fire for each node that is checked.&amp;nbsp; The checked state is remembered after the postback.&amp;nbsp; Click the button again and the checkchanged event will fire again for each checked node even though their checked state was not changed.&lt;/p&gt;</description></item><item><title>Re: TreeView adapter problem</title><link>http://forums.asp.net/thread/1421043.aspx</link><pubDate>Fri, 06 Oct 2006 21:08:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1421043</guid><dc:creator>Russ Helfand</dc:creator><author>Russ Helfand</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1421043.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1018&amp;PostID=1421043</wfw:commentRss><description>&lt;p&gt;Actually, I think I was wrong with my last comment.&amp;nbsp; Even if you have both OnTreeNodeCheckChanged and OnAdaptedTreeNodeCheckChanged (i.e., you have both the OnAdapted--- and the On--- version of the event handler) I don&amp;#39;t think you should see them called in a duplicate fashion.&amp;nbsp; Only one or the other should be being called.&lt;/p&gt;&lt;p&gt;I have been working on the TreeView adapter (for the next rev) a tremendous amount lately and have looked for this duplicate event invokation in the debugger, etc.&amp;nbsp; I don&amp;#39;t see it with my files.&lt;/p&gt;&lt;p&gt;Is there any way for you to create a very simple and complete test recipe that I can use to try to dup the problem here?&lt;/p&gt;</description></item></channel></rss>