Changing the displayed location of the RadColorPicker

3 posts, 1 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 17 May 2011 Link to this post

    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. Answer
    Niko
    Admin
    Niko avatar
    387 posts

    Posted 17 May 2011 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 17 May 2011 Link to this post

    Niko,

    That worked a treat.

    Many thanks.

    -- 
    Stuart
Back to Top