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

How to set Default value to resource control

2 Answers 133 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 05 Jul 2011, 04:11 PM
Hi ,

I'm using resource control in the Advance form.
I want to set default value for that control. How to access resource control in FormCreated event.

I was able to access text box and checkbox like this

CheckBox

 

 

ch = (CheckBox)e.Container.Controls[1].FindControl("IsPrivateCheckbox");

 

ch.Checked = System.

 

Convert.ToBoolean("True");

 

 

 

RadTextBox SubjectTextbox = (RadTextBox)e.Container.Controls[1].FindControl("SubjectText");

 

SubjectTextbox.Text = Session[

 

"PersonName"].ToString() + " On Call";


Please help.

 

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 08 Jul 2011, 02:34 PM
Hello Sam,

Here is an example how you can access the resource a resource with name Room:
protected void RadScheduler1_FormCreated1(object sender, SchedulerFormCreatedEventArgs e)
    {
        if (e.Container.Mode != SchedulerFormMode.Insert && e.Container.Mode != SchedulerFormMode.Edit)
        {
            RadComboBox combo = e.Container.FindControl("ResRoom") as RadComboBox;
            combo.SelectedIndex = 2;
        }
    }

You have to put the prefix "Res" in front of the name of the resource.

Hope this will help.

All the best,
Plamen Zdravkov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Sam
Top achievements
Rank 1
answered on 11 Jul 2011, 05:01 PM

Hi,

I was using ResControl and I changed to Radcombobox and it's
working fine now.

Thank you.
Tags
Scheduler
Asked by
Sam
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Sam
Top achievements
Rank 1
Share this question
or