I have a custom AdvancedScheduler Form in which I want to set the focus to a field programmatically in code behind.
So far I tried this, but although the code is called correctly, the .Focus() doesn't reflect in the form. What am I doing wrong?
01.
protected
void
RadSchedulerPlanning_FormCreated(
object
sender, SchedulerFormCreatedEventArgs e)
02.
{
03.
04.
if
( (e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert))
05.
{
06.
var aukunr = (RadComboBox) e.Container.Controls[1].FindControl(id:
"AUkunr"
);
07.
var textbausteinid = (RadDropDownList) e.Container.Controls[1].FindControl(id:
"Textbaustein_Id"
);
08.
if
(aukunr.Enabled)
09.
aukunr.Focus();
10.
else
11.
textbausteinid.Focus();
12.
}
13.
}