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

[Solved] Adding more features to the RadScheduler

3 Answers 159 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
developer
Top achievements
Rank 1
developer asked on 14 May 2008, 01:25 PM
My task is to add more features to the RadScheduler. I've recurring appointment with lots of users associated with one appointment. I want to show only the users associated to the appointment not everything from the database. Can you send me examples of the code of my particular instance - of how to display all users responsible for the appointment under More Details option. Next I want to display another information from the database in a textbox(right now it displays all the records, not just the information related to the appointment, as a drop-down of all the values in the database even those not related to the appointment).

3 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 16 May 2008, 01:12 PM
Hello,

If I understand you correctly, you want to display a read-only list of the associated users for the appointment. We can do this by handling the FormCreating event and hiding the unused resources by setting their Available property:

protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e) 
    foreach (Resource res in RadScheduler1.Resources) 
    { 
        res.Available = e.Appointment.Resources.Contains(res); 
    } 

This will only hide the unused resources, but it will not make the list read-only. If this is your true intention, we will send you the code to make it read-only.

Regarding the second problem, you can use custom attributes, as described in this help topic. This will give you the opportunity to edit some of the database columns in free-form text boxes. Again, let us know if this is your true intention.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
developer
Top achievements
Rank 1
answered on 16 May 2008, 01:38 PM
The following is my problem
I've the list of all users in my database with a chekbox in front of each name

<

telerik:ResourceType KeyField="usrID" Name="Users" TextField="UserName" ForeignKeyField="ID" DataSourceID="dsUsers" AllowMultipleValues="true" />

My task is to list all users when i click on an appointment and the specific users associated to the appointment should've a tick in it's checkbox.
  So in  RadScheduler1_FormCreated class, I'm retrieving all the users from the database table for a specific apppointment and trying to compare with the whole list of users in the Resource, to get the tick in front of it's respective checkbox

CheckBoxList

users = (CheckBoxList)e.Container.FindControl("Users"); // trying to get the resource checkboxlist
if (dtUsers.Rows.Count > 0)  // where dtUsers is the set of DataTable with users related to the appointment
{
    foreach (Resource resuser in RadScheduler1.Resources.GetResourcesByType("Users")){

        foreach (DataRow drcRow in dtUsers.Rows){

Int32 intusrID = Includes.Database.ConvertSQLInt32OK(drcRow["cusUser_usrID"]);

ListItem listitem1 = users.Items.FindByValue("usrID");

if (intusrID == Includes.Database.ConvertSQLInt32OK(resuser.Key))

listitem1.Selected =

true;
        }
    }
}

0
Peter
Telerik team
answered on 19 May 2008, 07:50 AM
Hello,

Thank for clarifying further what your goal is. I suggest you review the Multiple Resource Values as it looks like this is exactly what you need. I hope I am not missing something.


All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
developer
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
developer
Top achievements
Rank 1
Peter
Telerik team
Share this question
or