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

Changing the displayed location of the RadColorPicker

2 Answers 78 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 17 May 2011, 10:44 AM
I have a RadWindow that is used as a dialog. The page in it has a couple of RadColorPickers in it.

When displayed, the colour pickers are always displayed relative to the picker button which causes scrollbars to appear in the dialog, regardless of the size of the window (See this Jing video for an example).

My mark-up looks something like this ...
<telerik:RadColorPicker id="ColBackColour" runat="server" ShowIcon="true" KeepInScreenBounds="true" ShowEmptyColor="false" AutoPostBack="false" PreviewColor="false" Columns="35">
  <telerik:ColorPickerItem title="Light Pink" value="#FFB6C1"/>
  <!-- blah -->
</telerik:RadColorPicker >

I note that whatever I do there is always item level CSS injected to set the top and left of the colour picker. I need to be able to override this to set the position relative to the dialog bounds.

-- 
Stuart


2 Answers, 1 is accepted

Sort by
0
Accepted
Niko
Telerik team
answered on 17 May 2011, 02:34 PM
Hello Stuart,

You can take advantage of the OnClientPopUpShow client event and in its handler, using the RadColorPicker's getPaletteContainer method, change the left and top position values of the element:
function showPopup(picker, args)
{
    var paletteContainer = picker.getPaletteContainer();
    paletteContainer.style.left = "300px";
    paletteContainer.style.top = "100px";
}

Hope this helps.

Regards,
Niko
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Stuart Hemming
Top achievements
Rank 2
answered on 17 May 2011, 05:27 PM
Niko,

That worked a treat.

Many thanks.

-- 
Stuart
Tags
ColorPicker
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Niko
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or