Enabled Toggle but still allows "click"

Jun 8, 2011 at 2:32 PM
Edited Jun 8, 2011 at 3:03 PM

Does anyone know how to solve the issue of a button item that is been set to Enabled=False but the item still triggers a click event.  I would think if it is Disabled you cant click the button item.

Does anyone have any thoughts on this?

 

Thank you in advance.

 

Updated:

~~~~~~~~~~~~~~

in ToolbarButton.cs

Line 144 (in Bold)

It looks as though something should go there to disable the click, but I dont know how to program in C#.

 

Here is the IF block that I THINK should be fixed to solve this issue

 

            if (Enabled)
            {
                if (Selected)
                {
                    subClass = (!string.IsNullOrEmpty(CssClassSelected))
                        ? CssClassSelected : ToolbarParent.ButtonCssClasses.CssClassSelected;               
                }
               
                if (Enabled && subClass.Length == 0)
                {
                    subClass = (!string.IsNullOrEmpty(CssClassEnabled))
                        ? CssClassEnabled : ToolbarParent.ButtonCssClasses.CssClassEnabled;
                }
            }           
            else
            {
                subClass = (!string.IsNullOrEmpty(CssClassDisabled))
                    ? CssClassDisabled : ToolbarParent.ButtonCssClasses.CssClassDisabled; ;
            }

Coordinator
Jun 22, 2011 at 1:29 AM

I just checked the code that fixes this issue. Get the latest from the Source Control tab.

Jun 23, 2011 at 2:58 PM

Thanks for the fix,

Where is this “Get the latest from the Source Control tab.”

I cant seem to find it?  The Download Source says it wasn’t changed since March 2009.  Unless that is an error from the website?

Coordinator
Jun 24, 2011 at 12:08 AM

Looks like I checked it into the wrong place...it's there now. Sorry about that.

Jun 24, 2011 at 1:58 PM

Hey no worries.....I would have fixed it myself, but I dont write in C#, not am I good at reading it either. I am a VB.Net guy. Thank you for fixing it though.  Other than that, it was an awesome control....I am surprised MS hasnt made anything like that....Thanks again.

Jun 24, 2011 at 2:10 PM

Hey that updated source doesnt load....The orginal worked perfect.  This ZIP does not load standalone or if I Overwirte the files in the orginal package. After your update, the SLN file wont even open/respond. and if I click the project file I get this message:

Unable to read project file Toolbar.csproj

The imported project "C\Program Files\MSBuild\Microsoft\MicrosoftAjax\ajaxadmin.tasks" was not found.

Am I doing something wrong?

Coordinator
Jun 24, 2011 at 2:24 PM

You need to install the Microsoft Ajax Minifier.—it’s a new requirement. You can find it at: http://ajaxmin.codeplex.com/releases/view/68215.