Composite custom control broken by decorator

4 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 06 Aug 2008 Link to this post

    Hello,
    I am using a Paging control made as a composite control with  2 aspnet buttons+textbox+2 aspnet buttons + labels, they all have a fixed width.Their size and position are totally broken by decorator: width get bigger and they spersedd each other.
    My very light code :

            //Construct controls  
            protected override void  CreateChildControls()  
            {  
                Controls.Clear();  
     
        btnFirst                    =   new Button();  
                btnFirst.ID                 =   "Pager_BtnFirst";  
                btnFirst.Width              =   new Unit("25px");  
                btnFirst.Font.Bold          =   true;  
                btnFirst.Text               =   " |< ";  
                btnFirst.CommandArgument    =   "first";  
                btnFirst.EnableViewState    =   false;  
                Controls.Add(btnFirst);  
     
                btnPrev                     =   new Button();  
                btnPrev.ID                  =   "Pager_BtnPrev";  
                btnPrev.Width               =   new Unit("25px");  
                btnPrev.Font.Bold           =   true;  
                btnPrev.Text                =   " < ";  
                btnPrev.CommandArgument     =   "prev";  
                btnPrev.EnableViewState     =   false;  
                Controls.Add(btnPrev);  
     
                Controls.Add(new LiteralControl("&#160;"));  
                if (useRad)  
                {  
                    RadNumericTextBox tbPage    = new RadNumericTextBox();  
                    tbPage.ShowSpinButtons      = true;  
                    tbPage.MinValue             = 0;  
                    tbPage.Type                 = NumericType.Number;  
                    tbPage.AutoPostBack         = true;  
                    tbPage.NumberFormat.DecimalDigits = 0;  
                    tbPagetbPageNumber                = tbPage;  
                }  
                else  
                {  
                    TextBox tbPage              = new TextBox();  
                    tbPage.AutoPostBack         = true;  
                    tbPagetbPageNumber                = tbPage;  
                }  
                tbPageNumber.ID                 =   "Pager_PageNbr";  
     
                tbPageNumber.Width              =   new Unit("30px");  
                tbPageNumber.EnableViewState    =   true;  
                Controls.Add(tbPageNumber);  
     
                Controls.Add(new LiteralControl("&#160;"));  
     
                btnNext                         =   new Button();  
                btnNext.ID                      =   "Pager_BtnNext";  
                btnNext.Width                   =   new Unit("25px");  
                btnNext.Font.Bold               =   true;  
                btnNext.Text                    =   " > ";  
                btnNext.CommandArgument         =   "next";  
                btnNext.EnableViewState         =   false;  
                Controls.Add(btnNext);  
     
                btnLast                         =   new Button();  
                btnLast.ID                      =   "Pager_BtnLast";  
                btnLast.Width                   =   new Unit("25px");  
                btnLast.Font.Bold               =   true;  
                btnLast.Text                    =   " >| ";  
                btnLast.CommandArgument         =   "last";  
                btnLast.EnableViewState         =   false;  
                Controls.Add(btnLast);  
     
                lblof                           =   new Label();  
                lblof.ID                        =   "Pager_lblof";  
                lblof.EnableViewState           =   false;  
                lblof.Text                      =   "&#160;/&#160;";  
                Controls.Add(lblof);  
     
                lblPageCount                    =   new Label();  
                lblPageCount.ID                 =   "Pager_lbPgCnt";  
                lblPageCount.EnableViewState    =   false;  
                Controls.Add(lblPageCount);  
                  
                if (ViewState["PageNumber"] == null)  
                    PageNumber = 1;  
            }  
     

    Thanks for help.
    CS
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 06 Aug 2008 Link to this post

    Hello Christian,

    I am afraid that the provided information is not enough for us to reproduce your setup locally. Please open a support ticket and send us a small sample project where the problem can be reproduced - just make sure that the project can be run locally and attach it to the ticket. We will check it right away and do our best to help.




    Kind regards,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 06 Aug 2008 Link to this post

    Ok I have taken time to do it.
    CS
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 07 Aug 2008 Link to this post

    Hello Christian,

    Thank you for the project. We will check it and get back to you in the next several hours.


    Regards,
    Georgi Tunev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top