I am using custom provider for Scheduler. But the problem is I have more than 800 users in my system and I can't display all 800 users as Multiple section Resource on the page. Please let me know if there is any way to get around with this situation.
Thanks!
Alan
11 Answers, 1 is accepted
Just wondering if there is anyone from Telerik looking into this issue right now.
Alan
Please look at these demos:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resources/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourcegrouping/defaultcs.aspx
Are you looking for something similar?
Regards,
Hristo Valyavicharski
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Not quite what I am looking for. I am using following sample from your web site as reference(Implementing A Provider That Supports Multi-valued Resources):
http://www.telerik.com/help/aspnet-ajax/scheduler-provider-with-multi-valued-resources.html
public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType)
{
switch (resourceType)
{
case "Teacher" :
return Teachers.Values;
case "Student" :
return Students.Values;
default:
throw new InvalidOperationException( "Unknown resource type: " + resourceType);
}
}
private IDictionary<int, Resource> Teachers
{
get
{
if (_teachers == null)
{
_teachers = new Dictionary<int, Resource>();
foreach (Resource teacher in LoadTeachers())
{
_teachers.Add((int)teacher.Key, teacher);
}
}
return _teachers;
}
}
private IDictionary<int, Resource> Students
{
get
{
_students = new Dictionary<int, Resource>();
foreach (Resource student in LoadStudents())
{
_students.Add((int)student.Key, student);
}
return _students;
}
}
private IEnumerable<Resource> LoadTeachers()
{
List<Resource> resources = new List<Resource>();
using (DbConnection conn = OpenConnection())
{
DbCommand cmd = DbFactory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT [TeacherID], [Name], [Phone] FROM [DbProvider_Teachers]";
using (DbDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Resource res = new Resource();
res.Type = "Teacher";
res.Key = reader["TeacherID"];
res.Text = Convert.ToString(reader[ "Name" ]);
res.Attributes["Phone"] = Convert.ToString(reader["Phone"]);
resources.Add(res);
}
}
}
return resources;
}
private IEnumerable<Resource> LoadStudents()
{
List<Resource> resources = new List<Resource>();
using (DbConnection conn = OpenConnection())
{
DbCommand cmd = DbFactory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT [StudentID], [Name] FROM [DbProvider_Students]";
using (DbDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Resource res = new Resource();
res.Type = "Student";
res.Key = reader["StudentID"];
res.Text = Convert.ToString(reader[ "Name" ]);
resources.Add(res);
}
}
}
return resources;
}
But questions is what about I am having 800 students or teachers and I can't
just display all 800 the students or teachers on the page. It will slow down my
applications.
Please let me know if there is a way around this.
Alan
Try to put combo with checkbox support in the advanced form similar to this demo:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx
Regards,
Hristo Valyavicharski
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Thank you for your reply.
The question is how can I use Combo with checkbox support in the Scheduler Provider ?
Alan
Please find the attached sample.
I hope it helps.
Regards,
Hristo Valyavicharski
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Thanks again for your reply.
My application using DbSchedulerProviderBase class instead of AdvancedFormTemplate. Basically DbSchedulerProviderBase extends from SchedulerProviderBase as following:
public abstract class DbSchedulerProviderBase : SchedulerProviderBase
{
protected DbProviderFactory DbFactory { get { ... }; set { ... }; }
protected bool PersistChanges { get { ... }; set { ... }; }
protected string ConnectionString { get { ... }; set { ... }; }
public override void Initialize(string name, NameValueCollection config) { ... }
protected virtual DbConnection OpenConnection() { ... }
protected virtual DbParameter CreateParameter(string name, object value) { ... }
}
Then my application extends from DbSchedulerProviderBase class to implements Scheduler provider.
I am using your online documentation as my guideline, please check out the Link:
Implementing A Provider That Supports Multi-valued Resources
Hope I make my problem clear to you this time and sorry for any confusion.
Look forward to hearing from you.
Alan
Please find the attached sample. Browse CustomDBProvider\RadSchedulerAdvancedForm.aspx page. Is that what are you looking for?
Regards,
Hristo Valyavicharski
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I tried your code and realized showing 800 uses in the radcombox dramatically slowing down my page rendering every time the page loads. Using RadCombox control only saves space on the edit form, but it doesn't improve the page performance. On top of that , think about if half of users (400) accessing the page at same time, the system will freeze. I think we need better solution to handle large amount of users populate and access the Scheduler control.
I am running out ideas, but thanks anyway for your help.
Alan
The solution I have in my mind is the scheduler control should have option only showing the users in current appointment will display in the RadCombox . If we need to add more users to the appointment , we should have a add button to show or search users from database and the end user can select certain users to the appointment and also showing in the RadCombox. Populating all 800 uses at once to the appointment edit form is not practical. Beside the 800 users list will also need to repopulated again when page refreshes, it certainly has performance measurement drawbacks. I am sure Telerik controls build not just for small size system, also target for large system as well.
Hope it makes sense to you.
Alan
The improve the performance of the combo you can use combo's Load On Demand functionality. But load on demand functionality is not compatible with the multi item selection (checkbox support). This is a limitation. You may try to use the lightweight render mode of the combo and enable the cache support for the combo's datasource or remove checkbox-es and populate combo via web service.
Regards,
Hristo Valyavicharski
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.