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

Cannot assign value BUG

1 Answer 38 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
tomas
Top achievements
Rank 1
tomas asked on 12 Feb 2009, 09:40 PM
Hello.

I have my own web control which contains DateTimePicker.
protected override void Render(HtmlTextWriter writer)  
        {  
            //base.Render(writer);  
            this.SetInputNameAndControlID();  
 
            if (!this.DesignMode)  
                sm.RegisterScriptDescriptors(this);  
 
            dateTimePicker.ID = this.ID + "dateTimePicker";  
 
            // nastavení hodnoty              
            if (this._value != System.DateTime.MinValue)  
                thisthis.dateTimePicker.SelectedDate = this._value;  
            else  
                this.dateTimePicker.SelectedDate = null;  
              

As you can see I am trying to assign value to datetimepicker during its Render method.

The datetimepicker value is assigned only to popup calendar and not to the input textbox. Its input textbox is empty.

:-(

Thank you

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 Feb 2009, 06:32 AM
Hi Thomas,

You can access the DateInput of RadDateTimePicker and set the value from server side like shown below. Hope this helps.

CS:
((Telerik.Web.UI.RadDateInput)(dateTimePicker.Controls[0])).Text = "2009-02-04-00-00-00"

Thanks,
Princy.
Tags
Calendar
Asked by
tomas
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or