Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ColorPicker > Changing the displayed location of the RadColorPicker

Answered Changing the displayed location of the RadColorPicker

Feed from this thread
  • Posted on May 17, 2011 (permalink)

    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


    Reply

  • Answer Niko Niko admin's avatar

    Posted on May 17, 2011 (permalink)

    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.

    Reply

  • Posted on May 17, 2011 (permalink)

    Niko,

    That worked a treat.

    Many thanks.

    -- 
    Stuart

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > ColorPicker > Changing the displayed location of the RadColorPicker
Related resources for "Changing the displayed location of the RadColorPicker"

ASP.NET ColorPicker Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]