Hi,
I need to filter resources used by Radscheduler based on client interaction, how can I do that?
cmd.CommandText = "SELECT * FROM [Users] where id > 0 "; /*** would like to send this sql statement from client based on combobox selection 88?
<telerik:RadScheduler runat="server" ID="RadScheduler1" OnResourcesPopulating="RadScheduler1_ResourcesPopulating" SelectedView="WeekView"
OnClientAppointmentsPopulating="OnClientAppointmentsPopulating" Width="900px" Height="900px" OverflowBehavior="Scroll" OnClientResourcesPopulating="OnClientResourcesPopulating"
AppointmentStyleMode="Default"
>
<DayView UserSelectable="True" GroupBy="TechName" GroupingDirection="Horizontal" />
<WeekView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical" />
<MonthView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical" />
<TimelineView GroupBy="TechName" ColumnHeaderDateFormat="h:mm tt" GroupingDirection="Vertical" HeaderDateFormat="MM/dd/yyyy h:mm tt"
NumberOfSlots="21" SlotDuration="00:30:00" StartTime="08:00:00" />
<WebServiceSettings Path="M4SchWebService.asmx" ResourcePopulationMode="ServerSide" />
<ResourceTypes>
<telerik:ResourceType Name="TechName" />
<telerik:ResourceType Name="TicketState" />
</ResourceTypes>
</telerik:RadScheduler>
private IEnumerable<Resource> LoadTechNames()
{
List<Resource> resources = new List<Resource>();
try
{
using (DbConnection conn = OpenConnection())
{
DbCommand cmd = DbFactory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM [Users] where id > 0 "; /*** would like to send this sql statement from client based on combobox selection ****/
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd.CommandText, cmd.Connection as SqlConnection);
da.Fill(dt);
da.Dispose();
if (dt.Rows.Count < 1)
return resources;
foreach (DataRow row in dt.Rows)
{
Resource res = new Resource();
res.Type = "TechName";
res.Key = row["ID"];
res.Text = Convert.ToString(row["TechName"]);
//res.Attributes["Phone"] = Convert.ToString(row["Phone"]);
resources.Add(res);
}
}//end of using
}
catch (Exception ex)
{
throw ex;
}
return resources;
}
Thanks,
Prava
I need to filter resources used by Radscheduler based on client interaction, how can I do that?
cmd.CommandText = "SELECT * FROM [Users] where id > 0 "; /*** would like to send this sql statement from client based on combobox selection 88?
<telerik:RadScheduler runat="server" ID="RadScheduler1" OnResourcesPopulating="RadScheduler1_ResourcesPopulating" SelectedView="WeekView"
OnClientAppointmentsPopulating="OnClientAppointmentsPopulating" Width="900px" Height="900px" OverflowBehavior="Scroll" OnClientResourcesPopulating="OnClientResourcesPopulating"
AppointmentStyleMode="Default"
>
<DayView UserSelectable="True" GroupBy="TechName" GroupingDirection="Horizontal" />
<WeekView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical" />
<MonthView UserSelectable="True" GroupBy="TechName" GroupingDirection="Vertical" />
<TimelineView GroupBy="TechName" ColumnHeaderDateFormat="h:mm tt" GroupingDirection="Vertical" HeaderDateFormat="MM/dd/yyyy h:mm tt"
NumberOfSlots="21" SlotDuration="00:30:00" StartTime="08:00:00" />
<WebServiceSettings Path="M4SchWebService.asmx" ResourcePopulationMode="ServerSide" />
<ResourceTypes>
<telerik:ResourceType Name="TechName" />
<telerik:ResourceType Name="TicketState" />
</ResourceTypes>
</telerik:RadScheduler>
private IEnumerable<Resource> LoadTechNames()
{
List<Resource> resources = new List<Resource>();
try
{
using (DbConnection conn = OpenConnection())
{
DbCommand cmd = DbFactory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM [Users] where id > 0 "; /*** would like to send this sql statement from client based on combobox selection ****/
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd.CommandText, cmd.Connection as SqlConnection);
da.Fill(dt);
da.Dispose();
if (dt.Rows.Count < 1)
return resources;
foreach (DataRow row in dt.Rows)
{
Resource res = new Resource();
res.Type = "TechName";
res.Key = row["ID"];
res.Text = Convert.ToString(row["TechName"]);
//res.Attributes["Phone"] = Convert.ToString(row["Phone"]);
resources.Add(res);
}
}//end of using
}
catch (Exception ex)
{
throw ex;
}
return resources;
}
Thanks,
Prava