Problems with the placing of the drop Down

5 posts, 0 answers
  1. Rune
    Rune avatar
    43 posts
    Member since:
    May 2009

    Posted 15 Sep 2009 Link to this post

    Hi all,

    I have found a problem with the ComboBox when placing the page form inside other elements. In my example I have placed the page form in an ASCX control. I have to do it that way because of the CMS I'm using.

    The div outside the page form has a specific size and is centeret on the page.

    Apparantly the ComboBox drop down is positioned from the page form. This means that the dropdown now appears way to the right of it's intended position.

    What do I do?

    ASPX Page:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="HourKid_Usercontrols.WebForm1" %> 
     
    <%@ Register Src="WebUserControl1.ascx" TagName="WebUserControl1" TagPrefix="uc1" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
      <title></title
    </head> 
    <body> 
      <div style="width: 500px; height: 500px; margin: 0 auto; position: relative;"
        <uc1:WebUserControl1 ID="WebUserControl11" runat="server" /> 
      </div> 
    </body> 
    </html> 
     

    ASCX Control
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" 
      Inherits="HourKid_Usercontrols.WebUserControl1" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <div style="padding: 100px;"
      <div style="float: right; position: relative;"
        <telerik:RadComboBox ID="RadCbShareMail" ValidationGroup="Share" runat="server" AllowCustomText="true" 
          Skin="Vista" EmptyMessage="sdfsdf" DataTextField="Email" DataValueField="Email" 
          ChangeTextOnKeyBoardNavigation="true" MarkFirstMatch="true"
          <Items> 
            <telerik:RadComboBoxItem Text="sdfa" /> 
          </Items> 
        </telerik:RadComboBox> 
      </div> 
    </div> 
    </form> 
     


  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 15 Sep 2009 Link to this post

    Hello Rune,

    Just remove the positioning of the outer DIV:

    <div style="width: 500px; height: 500px; margin: 0 auto;"
            <uc1:WebUserControl ID="WebUserControl11" runat="server" /> 
        </div> 


    Regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rune
    Rune avatar
    43 posts
    Member since:
    May 2009

    Posted 15 Sep 2009 Link to this post

    Hi Paul,

    Yes I know that would be an option. But unfortunately that is part of the problem. The form is to be placed inside my design, so i cannot remove the outside positionings.

    I don't see why the ComboBox is dependent of the Page Form tag. It should be dependent on the body or html tag, wich is ALLWAYS on the outside.

    Would you recommend me to create a supportticket for the problem?
  5. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 18 Sep 2009 Link to this post

    Hi Rune,

    This is a hack, but may help you with your task. Add this function to the OnClientDropDownOpening handler of the RadComboBox:
    function dropDownOpen(sender, args) {
        var $ = $telerik.$;
        setTimeout( function() { $(sender._animationContainer).appendTo(document.body); }, 0 );
    }

    Let me know if this helps.

    Greetings,
    Kamen Bundev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. steve matheson
    steve matheson avatar
    28 posts
    Member since:
    Jul 2005

    Posted 01 Feb 2010 Link to this post

    I had the same problem and this worked like a charm!
    Thanks!!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017