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

Composite custom control broken by decorator

3 Answers 54 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 06 Aug 2008, 06:02 AM

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

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 06 Aug 2008, 02:15 PM
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.
0
CSurieux
Top achievements
Rank 2
answered on 06 Aug 2008, 03:55 PM
Ok I have taken time to do it.
CS
0
Georgi Tunev
Telerik team
answered on 07 Aug 2008, 08:13 AM
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.
Tags
FormDecorator
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
CSurieux
Top achievements
Rank 2
Share this question
or