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

AdvancedForm - RadComboBox too long

1 Answer 37 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tas
Top achievements
Rank 1
Tas asked on 24 Jan 2013, 02:22 PM
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.

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 29 Jan 2013, 01:11 PM
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.
Tags
Scheduler
Asked by
Tas
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or