Hello,
Need Help!I am using RadScheduler for displaying appointments.I have 2 Issues.
Issue 1 :
I am using DB2 database to display information for appointments.
I have a requirement to enable/disable button in each appointment based on database feild while the appointments are being loaded.
My Database field has either 'Y' or 'N'. If field is 'Y',disable the button.If field is 'N',enable the button on each appointment.
I added Button in Appointment Template along with other fields.
I referred this forum http://www.telerik.com/community/forums/aspnet-ajax/scheduler/i-wonder-if-it-is-not-available-in-rad-scheduler.aspx but couldn't helped me.
Code for the Reference:
Button1 should be disable/enable based on the field CAAREP(Action Report) which was include in CustomAttributeNames.
Issue 2:
My StartField and EndField are in DateTime format which are coming from database. I want to display only Time on Appointments.I tried the below way but it is displaying last appointment times on all the appointments.It is considering last appointment times.
Could someone Please provide me solution for this issue.
Many Thanks,
Sandhya.
Need Help!I am using RadScheduler for displaying appointments.I have 2 Issues.
Issue 1 :
I am using DB2 database to display information for appointments.
I have a requirement to enable/disable button in each appointment based on database feild while the appointments are being loaded.
My Database field has either 'Y' or 'N'. If field is 'Y',disable the button.If field is 'N',enable the button on each appointment.
I added Button in Appointment Template along with other fields.
I referred this forum http://www.telerik.com/community/forums/aspnet-ajax/scheduler/i-wonder-if-it-is-not-available-in-rad-scheduler.aspx but couldn't helped me.
Code for the Reference:
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
DataEndField
=
"CAETIME"
DataKeyField
=
"CAPPID"
DataStartField
=
"CASTIME"
DataSubjectField
=
"CAPVISIT"
OnAppointmentCreated
=
"RadScheduler1_AppointmentCreated"
OnDataBound
=
"RadScheduler1_DataBound"
CustomAttributeNames
=
"CACLIENT,CAAREP"
>
<
AppointmentTemplate
>
<
asp:Label
ID
=
"lblStart"
runat
=
"Server"
Text='<%#Eval("Start")%>'></
asp:Label
>
<
asp:Label
ID
=
"lblHyphen"
runat
=
"Server"
Text
=
'-'
></
asp:Label
>
<
asp:Label
ID
=
"lblEnd"
runat
=
"Server"
Text='<%#Eval("End") %>'></
asp:Label
><
br
/>
<
b
>Subject : </
b
>
<
asp:Label
ID
=
"lblSub"
runat
=
"server"
Text='<%#Eval("Subject")%>' /><
br
/>
<
b
>Client : </
b
>
<
asp:Label
ID
=
"lblClient"
runat
=
"Server"
Text='<%#Eval("CACLIENT")%>'></
asp:Label
><
br
/>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Action Report"
/>
</
AppointmentTemplate
>
</
telerik:RadScheduler
>
Button1 should be disable/enable based on the field CAAREP(Action Report) which was include in CustomAttributeNames.
Issue 2:
My StartField and EndField are in DateTime format which are coming from database. I want to display only Time on Appointments.I tried the below way but it is displaying last appointment times on all the appointments.It is considering last appointment times.
public
string
stime, etime;
DateTime dts, dte;
using
(DB2Command cmd =
new
DB2Command(viewAppT, conn))
{
cmd.CommandType = CommandType.Text;
DB2DataAdapter adp =
new
DB2DataAdapter(cmd);
DataSet dsAppt =
new
DataSet();
adp.Fill(dsAppt);
RadScheduler1.DataSource = dsAppt;
DataView dv = dsAppt.Tables[0].DefaultView;
RadScheduler1.DataSource = dv;
RadScheduler1.DataBind();
for
(
int
i = 0; i < dv.Table.Rows.Count; i++)
{
dts = Convert.ToDateTime(dv.Table.Rows[i][
"CASTIME"
]);
dte = Convert.ToDateTime(dv.Table.Rows[i][
"CAETIME"
]);
stime = dts.ToShortTimeString();
etime = dte.ToShortTimeString();
}
RadScheduler1.SelectedView = SchedulerViewType.MonthView;
RadScheduler1.SelectedDate = Convert.ToDateTime(dv.Table.Rows[0][
"CAETIME"
]);
RadScheduler1.Visible =
true
;
}
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
DataEndField
=
"CAETIME"
DataKeyField
=
"CAPPID"
DataStartField
=
"CASTIME"
DataSubjectField
=
"CAPVISIT"
OnAppointmentCreated
=
"RadScheduler1_AppointmentCreated"
OnDataBound
=
"RadScheduler1_DataBound"
CustomAttributeNames
=
"CACLIENT,CAAREP"
>
<
AppointmentTemplate
>
<%-- <
asp:Label
ID
=
"lblStart"
runat
=
"Server"
Text='<%#Eval("Start")%>'></
asp:Label
>--%>
<
asp:Label
ID
=
"Label1"
runat
=
"Server"
Text='<%# stime %>'></
asp:Label
>
<
asp:Label
ID
=
"lblHyphen"
runat
=
"Server"
Text
=
'-'
></
asp:Label
>
<%-- <
asp:Label
ID
=
"lblEnd"
runat
=
"Server"
Text='<%#Eval("End") %>'></
asp:Label
><
br
/>--%>
<
asp:Label
ID
=
"Label2"
runat
=
"Server"
Text='<%# etime %>'></
asp:Label
>
<
b
>Subject : </
b
>
<
asp:Label
ID
=
"lblSub"
runat
=
"server"
Text='<%#Eval("Subject")%>' /><
br
/>
<
b
>Client : </
b
>
<
asp:Label
ID
=
"lblClient"
runat
=
"Server"
Text='<%#Eval("CACLIENT")%>'></
asp:Label
><
br
/>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Action Report"
/>
</
AppointmentTemplate
>
</
telerik:RadScheduler
>
Could someone Please provide me solution for this issue.
Many Thanks,
Sandhya.