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

Rad Color Picker - Selected Color click event

2 Answers 241 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
anwar
Top achievements
Rank 1
anwar asked on 02 Mar 2010, 10:07 PM
Hello,

I want to fire the click event for the selected color from the MainPalette/StandardPalette list of colors, the reason for firing the click event is the SelectedColorChanged event is not firing. Please see the below Process. 

Can you help how to do this. 

Process:
I am using RadColorPicker to format the RadGridview columns. Here is what i am trying to do. I have a toolbar with RadColorPicker to set the font color, Gridview with three columns.
1. Select the column 1(radgridview doesnot support selecting the entire column, so i am using cellselected event to select the column) and click on the font color picker  from Toolbar and select the  color Red (SelectedColorChanged event fires and setting the gridview cell style to set the font color for the column1 ) .
2. Select the Column 2, click on the font color picker and the seleced color is Red, when i click on the Red color, the SelectedColorChanged event is not firing(the reason i am not selecting different color).
Note : I donot want to use the RadColorPicker_Click event, cause when i select the column 1 , my toolbar  fontcolor picker selected color has to show the Red, Column 3, the deault color shows to black for the font color picker. There is a two way communications between Tool Bar RadColorPicker and Gridview Columns.

Thanks,
Anwar
  

2 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 04 Mar 2010, 08:53 AM
Hello anwar,

You can accomplish the desired functionality by using the following:
this.colorPicker.DropDownOpened += new EventHandler(picker_DropDownOpened);
  
......
 void picker_DropDownOpened(object sender, EventArgs e)
        {    
   Popup popup = this.picker.ChildrenOfType<Popup>()[0];
   RadColorSelector selector = VisualTreeHelper.GetChild(popup.Child, 0) as RadColorSelector;
         selector.AddHandler(RadColorPaletteViewItem.MouseLeftButtonDownEvent, new System.Windows.Input.MouseButtonEventHandler(this.SelectorItemMouseClick), true);
        }
....
private void SelectorItemMouseClick(object sender, MouseButtonEventArgs e)
        {
                //add the desired functionality here
      }


Kind regards,
Bobi
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
namratha
Top achievements
Rank 2
answered on 11 Nov 2010, 02:09 PM
Popup missing assembly reference
Tags
ColorPicker
Asked by
anwar
Top achievements
Rank 1
Answers by
Bobi
Telerik team
namratha
Top achievements
Rank 2
Share this question
or