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

Problem with SelectedItem property in RadColorPaletteView control.

1 Answer 30 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
SivaPrasad Bevara
Top achievements
Rank 1
SivaPrasad Bevara asked on 14 Feb 2011, 04:56 PM
Hi,

I am using "RadColorPaletteView" to display custom colors.

I need to change the application theme, when we select the color from the "RadColorPaletteView".

I am using the following code in the SelectionChanged event to get the selected color.
string strColor = ((RadColorPaletteView)e.OriginalSource).SelectedItem.ToString();

I am able to get the color when I select the color for the first time. If I try to select another color it is returning the ((RadColorPaletteView)e.OriginalSource).SelectedItem as null.

How can I get the selected color from the "RadColorPaletteView".

I tried to use the "(((RadColorPaletteView)e.OriginalSource)).SelectedPaletteViewItem.Color". With this I am getting some missing assembly reference error.

Please help.

Regards,
SivaPrasad.B

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 15 Feb 2011, 08:12 PM
Hello SivaPrasad Bevara,

This appears to be a bug in the RadColorPalleteView. We logged it in our PITS(ColorPicker: RadColorPaletteView `s SelectionChanged event fires twice) and updated your telerik points accordingly. You will be soon able vote for this issue ( it will be uploaded in the next 24 hours). As a workaround you can do like so:

privatevoidPalette_SelectionChanged(objectsender, Telerik.Windows.Controls.SelectionChangedEventArgs e) 
        { 
            if(this.palette.SelectedItem != null
            { 
                        string strColor = ((RadColorPaletteView)e.OriginalSource).SelectedItem.ToString();

            }            } 
        }

Please accept our apologies for the inconvenience caused and feel free to ask if you need further help.

Kind regards,
Petar Mladenov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
ColorPicker
Asked by
SivaPrasad Bevara
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or