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(" ")); |
| 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(" ")); |
| 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 = " / "; |
| 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