How to set Default value to resource control

3 posts, 0 answers
  1. Sam
    Sam avatar
    7 posts
    Member since:
    Jan 2011

    Posted 05 Jul 2011 Link to this post

    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. Plamen
    Admin
    Plamen avatar
    2933 posts

    Posted 08 Jul 2011 Link to this post

    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!

  3. Sam
    Sam avatar
    7 posts
    Member since:
    Jan 2011

    Posted 11 Jul 2011 Link to this post


    Hi,

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

    Thank you.
Back to Top