Bind radcombobox inside the rad scheduler in mvc4

2 posts, 0 answers
  1. Gaurav
    Gaurav avatar
    14 posts
    Member since:
    May 2013

    Posted 27 May 2013 Link to this post

    Hi,
        I m using the radcombobox inside the rad scheduler with mvc 4  and i want to bind the radcombobox with my database in jquery please reply urgent.

    thanks 
    Gaurav Rana
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 30 May 2013 Link to this post

    Hello,

     
    You can achieve is as in the code below for example:

    function OnClientFormCreated(sender, args) {
                 var mode = args.get_mode();
                 if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert) {
     
     
                     var $ = $telerik.$;
                     var comboObject = $("[id$='AdvancedInsertForm_RadComboBox3']")
     
                     var combo = $find(comboObject.attr("id"));
                     var items = combo.get_items();
                     combo.trackChanges();
                     for (var i = 0; i < 5; i++) {
                         var comboItem = new Telerik.Web.UI.RadComboBoxItem();
                         comboItem.set_text("New" + i);
                         comboItem.set_value(i);
                         items.add(comboItem);
                     }
     
     
                 } else if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
     
                     var $ = $telerik.$;
                     var comboObject = $("[id$='AdvancedEditForm_RadComboBox3']")
                     debugger;
                     var combo = $find(comboObject.attr("id"));
                     var items = combo.get_items();
                     combo.trackChanges();
                     for (var i = 0; i < 5; i++) {
                         var comboItem = new Telerik.Web.UI.RadComboBoxItem();
                         comboItem.set_text("New" + i);
                         comboItem.set_value( i);
                         items.add(comboItem);
                     }
     
                 }
     
             }


    <p>
                           <telerik:RadComboBox runat="server" ID="RadComboBox3" AutoPostBack="false">
     
                           </telerik:RadComboBox>
                         </p>
                         <asp:Panel runat="server" ID="Panel1" CssClass="rsAdvancedSubmitArea">

    Hope this will be helpful.

    Regards,
    Plamen
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top