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

OnClientColorChange get_selectedColorTitle returns null

2 Answers 52 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
moegal
Top achievements
Rank 1
moegal asked on 14 Aug 2014, 11:54 PM
Help!!

OnClientColorChange
sender.get_selectedColorTitle()  returns null

sender.get_selectedColor() works fine. And when I hover on a color chip it displays the color title just fine.

I am using the color picker with custom color list that I have set the in code behind like so:

RadColorPicker rcp = new RadColorPicker();
                rcp.ID = "colorsId";
                rcp.CssClass = "cFieldRight idcolorsId";
                //rcp.ToolTip = "Select GARMENT COLOR CHOICES";
                rcp.EnableViewState = false;
                rcp.Preset = ColorPreset.None;
                rcp.ShowIcon = false;
                rcp.ShowEmptyColor = false;
                rcp.PreviewColor = false;
                //rcp.Columns = 15;
                rcp.OnClientColorChange = "$.pc5.Colors_OnClientColorChange";
 
                foreach (DataRow dataRow in dt.Rows)
                {
                    string colorName = (string)dataRow["Name"];
                    string colorValue = (string)dataRow["ItemColor"];
                    ColorPickerItem item = new ColorPickerItem();
                    item.Title = colorName;
                    item.Value = ColorTranslator.FromHtml(colorValue);
                    rcp.Items.Add(item);
                }
 
                rcp.SelectedColor = ColorTranslator.FromHtml("#FFFFFF");
                ph.Controls.Add(rcp);


Thanks, Marty

2 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 18 Aug 2014, 04:26 PM
Hello,

I created a sample page from the code snippet you provided and tried to reproduce the described problem, but to no avail. Please check the attached sample page and compare it to your actual project. If there are differences in the setup, describe them so that I can change my test page accordingly. You can also modify the attached page so that the problem is reproducible and send it for further inspection.

Regards,
Slav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
moegal
Top achievements
Rank 1
answered on 19 Aug 2014, 03:18 PM
Slav,

Thanks I am looking at your example now.

Marty
Tags
ColorPicker
Asked by
moegal
Top achievements
Rank 1
Answers by
Slav
Telerik team
moegal
Top achievements
Rank 1
Share this question
or