This is a migrated thread and some comments may be shown as answers.

Client Events

1 Answer 97 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Ryan Means
Top achievements
Rank 1
Ryan Means asked on 31 Oct 2008, 04:37 PM
I have two questions regarding the client side API of the RadColorPicker.

1.  How am I supposed to know what is avaliable in the eventArgs of the OnClientColorChanged client side event handler?  The documentation sample http://www.telerik.com/help/aspnet-ajax/color_clientonclientcolorchange.html references the use of eventArgs.get_oldColor() but the documentation of the client object http://www.telerik.com/help/aspnet-ajax/color_clientobject.html does not talk about the "get_oldColor()".

2.  How can I add items to the client side event args?  What I would like to add is the client id of a textbox that should be updated when the selected color is changed.  More specifically I would like to set the client id of the textbox to update from the server (c# code) so I can reference the passed in eventArgs to get the id of the textbox to update.

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 05 Nov 2008, 12:03 PM
Hi Ryan Means,
I just answered your support ticket with the same question. I will give the information here as well, so that it is available to all:

***
  1. The get_oldColor method is a method of the arguments, that the event handler receives as second parameter. As mentioned in the documentation - this handler receives 2 parameters:
    1. The color picker instance that fired the event - this is a color picker client object which has all the methods and properties, described in the http://www.telerik.com/help/aspnet-ajax/color_clientobject.html topic.
    2. Event arguments - these have the get_oldColor method.
  2. You cannot add items to the event arguments that the event handler receives. Those are created by the color picker control itself and you have no control over the code that instantiates them. You will need to find another way to pass the ClientID to the event handler - e.g. use a convention for the IDs of the control (RacColorPicker1 updates Textbox1, RadColorPicker2 updates Textbox2).

***

Sincerely yours,

Tsvetie

the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ColorPicker
Asked by
Ryan Means
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or