Hi,
I have a requirement to create a number of server controls (e.g. asp textboxes etc.) as well as RadDateTimePickers dynamically (e.g. at runtime) on a webform. I'm using the same approach to create instances of both types of control (see below):
Because they're created dynamically I recreate the controls every time there is a postback. I've noted that the regular asp controls maintain any values entered into them automatically after they're recreated however the RadDateTimePickers don't. Is there something I'm missing?
Thanks
I have a requirement to create a number of server controls (e.g. asp textboxes etc.) as well as RadDateTimePickers dynamically (e.g. at runtime) on a webform. I'm using the same approach to create instances of both types of control (see below):
TextBox txt =
new
TextBox();
txt.ID =
"someid"
txt.CssClass =
"my-textbox-class"
;
ph.Add(txt);
//add to placeholder control
RadDateTimePicker dtp =
new
RadDateTimePicker();
dtp.ID =
"adifferentid"
;
dtp.Width =
new
Unit(200, UnitType.Pixel);
dtp.DateInput.CssClass =
"my-datepicker-class"
;
dtp.TimeView.Interval =
new
TimeSpan(0, 30, 0);
dtp.TimeView.Columns = 6;
ph.Add(dtp);
//add to placeholder control
Because they're created dynamically I recreate the controls every time there is a postback. I've noted that the regular asp controls maintain any values entered into them automatically after they're recreated however the RadDateTimePickers don't. Is there something I'm missing?
Thanks