Telerik Rad Date Time Picker
Telerik is the external plugin for .net, it includes more features like grid,date time picker, calender, etc.Rad Date time picker is used to simplify the users work, all you need to add the telerik plugin files and just call the controller and place it where you want.
Example:-
<telerik:RadTimePicker ID="RAD_ID" runat="server">
</telerik:RadTimePicker>
Rad Date Time Picker Disable the Direct Input
In the above code user can directly enter their input to text box, if we want to remove user direct input to text box you can use the DateInput-Enabled="false".
If you didn’t use the DateInput-Enabled="false" user can edit like below screen shot.
Change Rad Date Picker Column size
In default setting only 3 columns are display horizontally, but we can change the size of the column using <TimeView> tag. It should be write like below.
<telerik:RadTimePicker ID="RAD_ID" runat="server" DateInput-Enabled="false">
<TimeView ID="TimeView6" runat="server" Columns="8">
</TimeView>
</telerik:RadTimePicker>
Call a client side function
Call a client side function, when you change the rad time picker value, the <ClientEvents OnSelected="fun_name"> this function will execute..
<script type="text/javascript">
function Call_fun()
{
alert("Date Selected");
}
</script>
------------------
------------------
<telerik:RadTimePicker ID="RAD_ID" runat="server" DateInput-Enabled="false">
<TimeView ID="TimeView6" runat="server" Columns="8">
</TimeView>
<ClientEvents OnDateSelected="Call_fun" />
</telerik:RadTimePicker>
Get the Value from Rad Date Time Picker
After selected the Time from read date time picker, you can get the selected time from the rad date picker by the below method.
var timestart = $find("<%=RAD_ID.ClientID %>");
var starttime = timestart.get_dateInput().get_value();
(OR)
var timestart = $find("<%=RAD_ID.ClientID %>").get_dateInput().get_value();
Clear the Value in Rad Date Time Picker
In some situation we need to clear the value from the Rad Date Time picker Text box in that time we can clear it using “set_selectedDate”.
<script type="text/javascript">
function clear_time()
{
$find("<%RAD_ID.ClientID %>").set_selectedDate(null);
}
</script>
0 comments:
Post a Comment