AdvancedForm - RadComboBox too long

2 posts, 0 answers
  1. Tas
    Tas avatar
    8 posts
    Member since:
    Sep 2012

    Posted 24 Jan 2013 Link to this post

    Hi,
    On an Advanced Form I have a RadComboBox that holds a list of Contact records which is populated using a SqlDataSource. The problem is that this list contains thousands of records, each of which are supposed to be displayed in the RadComboBox - but this crashes the application with a JSON error (because this list is probably too long for the RadComboBox).

    Is there a way that a more graceful solution be implemented such as the following:

    1. User double-clicks an empty slot in Scheduler to create new appointment
    2. This opens up a special popup form (like the advanced form) where they can search and select the Contact record they want (using search text box, RadGrid, checkboxes). Click a 'Select' button
    3. This then opens the Advanced Form with the selected Contact record details in it.

    Please let me know if there is a way to do this or some examples that may point me in the right direction.

    Many thanks.
  2. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 29 Jan 2013 Link to this post

    Hi Tas,

     
    You can ass a custom css class to the clicked timeslot and after that open the advanced form as in the code below:
     

    <script type="text/javascript">
              var $ = $telerik.$;
              function OnClientAppointmentInserting(sender, args) {
                  var slot = $(args.get_targetSlot().get_domElement());
                  slot.addClass("toInsertIn");
                  args.set_cancel(true);
                  alert("open your custom form");
              }
     
              function OnClientClicked(sender, args) {
     
                  var scheduler = $find('<%= RadScheduler1.ClientID %>');
              
                  var timeSlot = scheduler.get_activeModel().getTimeSlotFromDomElement($(".toInsertIn").get(0))
                  scheduler.showInsertFormAt(timeSlot);
              }
     
          </script>
          <telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Metro"
              StartInsertingInAdvancedForm="true" OnClientAppointmentInserting="OnClientAppointmentInserting"
               SelectedView="MonthView">
     
          </telerik:RadScheduler>
          <telerik:RadButton runat="server" ID="RadButton1" AutoPostBack="false"
              OnClientClicked="OnClientClicked"></telerik:RadButton>


    As for the way to populate the resources in the advanced form you can refer to this online demo where similar scenario is implemented.

    Hope this will be helpful.


    Regards,
    Plamen
    the Telerik team
    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