Hello.
I have a DateTimePicker control with set MinDate to "DateTime.Now". When a user selects a date, the calendar sets the time to 00:00, by default.
Problem is: when a user selects today's date it will be invalid. So, I'd like to intercept this somehow and set the date to MinDate instead. The same thing is with the time picker - if user selects a time that is bellow minimum, I'd rather reset it to minimum value then getting the invalid red border.
Here's a code I've tried, I guess I'm doing something wrong:
| <script language="javascript"> |
| function In_DateSelected(sender, e) |
| { |
| var calendarIn = $find("<%= dateTimeIn.ClientID %>"); |
| var newDate = e.get_newDate(); |
| if(newDate == null) |
| { |
| newDate = calendarIn.get_minDate(); |
| calendarIn.set_selectedDate(newDate); |
| } |
| } |
| </script> |
| <telerik:RadDateTimePicker ID="dateTimeIn" runat="server" Width="220px" EnableTyping="false" ClientEvents-OnDateSelected="In_DateSelected" /> |

function OnClientExpandedHandler(sender, args)
{
var splitter = $find("RadSplitter1");
var pane = splitter.GetPaneById("RadPane1");
var slidingZone = $find("SlidingZone1");
var paneID = slidingZone.GetPaneById("RadSlidingPane1");
slidingZone.DockPane(paneID); // dock the pane
alert('but yet it is not docked');
| <textarea id="situation1" style="width: 100%;" class="textInput" rows="4"></textarea> | |
| <telerik:RadSpell ID="rsSpellCheck_situation" ButtonType="LinkButton" runat="server" ControlToCheck="situation1" IsClientID="False" FragmentIgnoreOptions="All" SpellCheckProvider="PhoneticProvider" SupportedLanguages="en-US,English" WordIgnoreOptions="None" DictionaryPath="~/App_Data/RadSpell" /> | |
| <script type="text/javascript"> | |
| /*<![CDATA[*/ | |
| function MultipleTextSource(sources) | |
| { | |
| this.sources = sources; | |
| this.get_text = function() | |
| { | |
| var texts = []; | |
| for (var i = 0; i < this.sources.length; i++) | |
| { | |
| texts[texts.length] = this.sources[i].get_text(); | |
| } | |
| return texts.join("<controlSeparator><br/></controlSeparator>"); | |
| } | |
| this.set_text = function(text) | |
| { | |
| var texts = text.split("<controlSeparator><br/></controlSeparator>"); | |
| for (var i = 0; i < this.sources.length; i++) | |
| { | |
| this.sources[i].set_text(texts[i]); | |
| } | |
| } | |
| } | |
| function startSpell() | |
| { | |
| var sources = | |
| [ | |
| new Telerik.Web.UI.Spell.HtmlElementTextSource($get('situation1')), | |
| new Telerik.Web.UI.Spell.HtmlElementTextSource($get('newNote1')) | |
| ]; | |
| var spell = GetRadSpell('<%= rsSpellCheck_situation.ClientID %>'); | |
| spell.set_textSource(new MultipleTextSource(sources)); | |
| spell.startSpellCheck(); | |
| } | |
| /*]]>*/ | |
</script>
|
|
|
Chinese (Simplified) |
|
Chinese (Traditional) |
|
English (U.K.) |
|
English (U.S.) |
|
French (Canada) |
|
French (France) |
|
German |
|
Italian |
|
Japanese |
|
Portuguese (Brazil) |
|
Spanish |
