Adding RadCombo to Calendar Dayrender events results in Null Page

3 posts, 0 answers
  1. Ryan
    Ryan avatar
    13 posts
    Member since:
    Jan 2008

    Posted 14 Jul 2008 Link to this post

    If I build a RadComboBox and add it to my day I get a null page error, however if I use standard asp.net dropdownlist it works fine....

    Commented code fails...

           protected void Page_Load(object sender, EventArgs e)  
            {  
                RadCalendar1.SelectedDate = DateTime.Now;  
                this.RadCalendar1.DayRender += new Telerik.Web.UI.Calendar.DayRenderEventHandler(RadCalendar1_DayRender);  
     
            }  
     
            private void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)  
            {  
                 
       
                //RadComboBox rdcbo = new RadComboBox();  
                //rdcbo.ID = "bah" + e.Day.Date.ToShortDateString();  
                //RadComboBoxItem radcboitem = new RadComboBoxItem();  
                //radcboitem.Text = "Joe Schmo";  
                //radcboitem.Value = "0" + "|" + "12345" + "|" + "54321";  
                //rdcbo.Items.Add(radcboitem);  
                //e.Cell.Controls.Add(rdcbo);  
                DropDownList ddl1 = new DropDownList();  
                ddl1.ID = "bah" + e.Day.Date.ToShortDateString();  
                ListItem li1 = new ListItem();  
                li1.Text = "Joe Schmo";  
                li1.Value = "0" + "|" + "12345" + "|" + "54321";  
                ddl1.Items.Add(li1);  
                e.Cell.Controls.Add(ddl1);  
                  
                  
            }  
     

    Any ideas?
  2. Ryan
    Ryan avatar
    13 posts
    Member since:
    Jan 2008

    Posted 16 Jul 2008 Link to this post

    Anyone?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. John
    John avatar
    416 posts
    Member since:
    Oct 2006

    Posted 18 Jul 2008 Link to this post

    hi:)

    Because the DayRender event is raised while the RadCalendar control is being rendered, you cannot add a ScriptControl like RadComboBox. You can only add static controls, such as System.Web.UI..::.LiteralControl, Label, Image, and HyperLink.



    Thank you...
    <John:Peel />
Back to Top