drop down box for subject

6 posts, 0 answers
  1. Dan
    Dan avatar
    32 posts
    Member since:
    Feb 2010

    Posted 10 Aug 2011 Link to this post

    I'd like to override the subject textbox and have a listbox there instead. Do I need to use advancedinserttemplate for this? This is the only input field I want to customize. Do I have to explicitly define every field on the insert form if I do it that way. Are there any decent examples of this?

    Thanks,
    Dan
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 16 Aug 2011 Link to this post

    Hello Dan,

    Here is a sample demo project that is showing one way you can input a listbox instead of the subject textbox without a template.

    Hope this will be helpful.

    Kind regards,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Dan
    Dan avatar
    32 posts
    Member since:
    Feb 2010

    Posted 16 Aug 2011 Link to this post

    Thanks Plamen, that would be great. Just having trouble compiling it because it is .Net v4 and I am using vs2008 and it is giving me an error on targetFramework in the web.config
  4. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 19 Aug 2011 Link to this post

    Hello Dan,

    I removed "targetFramework="4.0"" from the web config code and added the appropriate(3.5) version of our Telerik.Web.UI product and it worked with Visual Studio 2008 at my side.

    Hope this will help.

    Best wishes,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Dan
    Dan avatar
    32 posts
    Member since:
    Feb 2010

    Posted 19 Aug 2011 Link to this post

    Any chance you could zip that up? Made changes but still getting errors... Thanks!
  6. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 24 Aug 2011 Link to this post

    Hi Dan,

    Here is the project that worked at my side at Visual studio 2008 with tha latest 3.5 version of our product.

    In case you still can't run it here is the code that is used:
    aspx:
    <script type="text/javascript">
           var subjectTextBox;
           function OnLoadSubjectTextBox(sender) {
               subjectTextBox = sender;
           }
           function OnClientSelectedIndexChanging(sender, args) {
               subjectTextBox.set_value(args.get_item().get_text());
     
           }
           
       </script>

    javascript:
    <script type="text/javascript">
           var subjectTextBox;
           function OnLoadSubjectTextBox(sender) {
               subjectTextBox = sender;
           }
           function OnClientSelectedIndexChanging(sender, args) {
               subjectTextBox.set_value(args.get_item().get_text());
     
           }
           
       </script>

    code-behind:
    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
       {
           if (e.Container.Mode == SchedulerFormMode.AdvancedInsert || e.Container.Mode == SchedulerFormMode.AdvancedEdit)
           {
               RadListBox lb1 = new RadListBox();
               lb1.Items.Add(new RadListBoxItem("a"));
               lb1.Items.Add(new RadListBoxItem("b"));
               lb1.Items.Add(new RadListBoxItem("c"));
               lb1.OnClientSelectedIndexChanging = "OnClientSelectedIndexChanging";
               RadTextBox subject = e.Container.FindControl("Subject") as RadTextBox;
               subject.ClientEvents.OnLoad = "OnLoadSubjectTextBox";
               subject.CssClass = "textbox";
               subject.Parent.Controls.Add(lb1);
               lb1.CssClass = "listbox";
           }
       }


    Regards,
    Plamen Zdravkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top