Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ColorPicker > ColorChanged EH not firing

Not answered ColorChanged EH not firing

Feed from this thread
  • Scott avatar

    Posted on Dec 27, 2007 (permalink)

    i setup my radcolorpicker control here:

                ctrlColorPicker1 = new RadColorPicker(); 
                ctrlColorPicker1.ID = "radColorPicker1"
                ctrlColorPicker1.Preset = ColorPreset.Standard; 
                ctrlColorPicker1.SelectedColor = Color.Blue; 
                ctrlColorPicker1.ShowIcon = true
                ctrlColorPicker1.AutoPostBack = true
                ctrlColorPicker1.ColorChanged += new EventHandler(ctrlColorPicker1_ColorChanged); 
                Controls.Add(ctrlColorPicker1); 

    my event handler definition is as follows:

            private void ctrlColorPicker1_ColorChanged(object sender, EventArgs e) 
            {} 

    i follow the flow in my debugger, and the event handler is not called when i select a new color from the radcolorpicker.

    any ideas?

    Reply

  • Georgi Tunev Georgi Tunev admin's avatar

    Posted on Dec 28, 2007 (permalink)

    Hello Scott,

    I am not sure what the problem is because you haven't sent your full code. That is why I made a small sample based on your code excerpt (I've had to modify it a little bit) and as you can see from the attached movie, everything is working as expected.

    I also attached the test page that I used - can you please check it and let me know if I am missing something?




    Best wishes,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Scott avatar

    Posted on Dec 28, 2007 (permalink)

    This is my full code:

            private Label label1; 
            private RadColorPicker ctrlColorPicker1; 
             
            public RadControlPrometheus() 
            { 
                this.ExportMode = WebPartExportMode.All; 
            } 
     
            protected override void CreateChildControls() 
            { 
     
                label1 = new Label(); 
                label1.ForeColor = Color.Black; 
                label1.Text = ""
                Controls.Add(label1); 
     
                ctrlColorPicker1 = new RadColorPicker(); 
                ctrlColorPicker1.ID = "radColorPicker1"
                ctrlColorPicker1.Preset = ColorPreset.Standard; 
                ctrlColorPicker1.SelectedColor = Color.Blue; 
                ctrlColorPicker1.ShowIcon = true; // this makes the color picker show as an icon until selected 
                ctrlColorPicker1.AutoPostBack = true; // must be set for event handlers to fire 
                ctrlColorPicker1.ColorChanged += new EventHandler(ctrlColorPicker1_ColorChanged); 
                Controls.Add(ctrlColorPicker1); 
     
     
            } 
     
            private void ctrlColorPicker1_ColorChanged(object sender, EventArgs e) 
            { 
     
                label1.Text = "Color Changed at " + DateTime.Today; 
     
            } 

    I simplified my code to resemble your example, except utilizing a MOSS web part.  Debugging this code, the event fires, but the label is never updating.  I can't explain it.

    Reply

  • Tervel Tervel admin's avatar

    Posted on Jan 2, 2008 (permalink)

    Hello Scott,

    Your code seems correct, and we were not able to find any flaws. Also, as you write yourself, the RadColorPicker event does fire (as it fires in the example provided by us).

    If the label does not get udpated, the reason for this is outside of the scope of the code. We are not able to help further, as the RadColorPicker does work properly.

    Greetings,
    Tervel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Scott avatar

    Posted on Jan 2, 2008 (permalink)

    Tervel,

    It looks like the trouble goes a little deeper than just the label not reflecting a text change.  The event handler fires the first time I change the color, but no subsequent times.  I event went as far as removing all code from within the event handler function.  Still, the page only posted back on the first color change.

    Scott

    Reply

  • Scott avatar

    Posted on Jan 3, 2008 (permalink)

    Further investigation:

    I replaced all RadColorPickers in my solution with DropDownList controls filled with ListItems representing Colors.  Everything works.

    I don't know what it is about the RadColorPicker in my MOSS WebPart's CreateChildControls method, but it seems to stop responding during the 1st event fire.  Hopefully I am not the only one having this issue, and it will be resolved in a future build of the prometheus control line.

    Reply

  • Tsvetie Tsvetie admin's avatar

    Posted on Jan 8, 2008 (permalink)

    Hi Scott,
    I tried to reproduce the problem you describe, but to no avail, the event fires every time I change the color - please find my test project attached. If you send us a simple running project, demonstrating the described behavior, we will do our best to find what is causing it. 

    All the best,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
    Attached files

    Reply

  • Scott avatar

    Posted on Jan 8, 2008 (permalink)

    to accurately replicate the issue i am referencing, you will need to create a System.Web.UI.WebControls.WebParts.WebPart project, override the createchildcontrols method with code for your radcolorpicker, and then deploy to a MOSS environment.  within the site collection you added the solution to, edit/add web part to a page.  the firing of the radcolorpicker does not work.

    hope this helps shed some light...

    Reply

  • Tsvetie Tsvetie admin's avatar

    Posted on Jan 11, 2008 (permalink)

    Hi Scott,
    In order to speed up the process of finding the cause for the problem, I would like to ask you to send us your code. Unfortunately, so far we have not been able to reproduce it on our side.

    Kind regards,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ColorPicker > ColorChanged EH not firing
Related resources for "ColorChanged EH not firing"

ASP.NET ColorPicker Features  |  Documentation  |  Demos  |  Step-by-step Tutorial  ]