This is a migrated thread and some comments may be shown as answers.

Validator Callout doesn't work on RadDatePicker

3 Answers 129 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Craig Nicholson
Top achievements
Rank 1
Craig Nicholson asked on 01 Sep 2008, 02:35 AM
Hi, I hope you can help with this one.

I have implemeted a RadDatePicker alongside a number of bog standard ASP.NET text boxes. On each of these I have hooked up a required field validator and validator callout extender which fire on a button click.

If I leave the boxes empty, the validators sucessfully fire and identify which fields are not populated including the DatePicker. The callout is displayed on the first text box that is invalid. All good so far.

However when I tab between the boxes, the callout moves from box to box for the text boxes but doesn't display at all for the RadDatePicker inputs. Basically any time you give the date picker input focus, the validator call out doesn't display. This gives a really inconsistent feel for validation.

I'm using v.2008.01.0619.20 of the Telerik.Web.UI dll

This appears to be a problem that is specific to the Input control, not the date picker. RadNumericTextBox seems to have the same problem.

Any ideas?

Regards,
Glyn.

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 04 Sep 2008, 08:25 AM
Hi Craig,

I tried to reproduce this however everything worked fine in my example (attached). The date-picker is populated initially with current date and if you delete this entry and try to tab the validator callout extender will work as expected..

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Craig Nicholson
Top achievements
Rank 1
answered on 04 Sep 2008, 08:43 PM
Hi Vlad,

Thanks for getting back to me on this one. I agreed that the validator extender does work in some scenarios like the one you attached. The problem I described is when the RadInput is not the first input control that fails validation.

I have taken your example and extended to show what the problem is. Replace your default.aspx with this code. Scenario information is written in the default.aspx. Hope this will help.

<%@ Page Language="C#" %> 
 
<%@ Register TagPrefix="ajaxToolkit" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<script runat="server"
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        if (!IsPostBack) 
        { 
            //RadDatePicker1.SelectedDate = DateTime.Now; 
            //RadDatePicker1.Focus(); 
        } 
    } 
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        Scenario: <br /> 
        Step 1 - Blank entry screen presented. Click Save. Validators fire, First Name validator extender shows. <br /> 
        Step 2 - Enter some text into first name. Tab to surname. Note: validator extender moves to surname as expected. <br /> 
        Step 3 - Enter some data into surname. Tab to date. Note: validator extender does NOT move to date picker. <br /> 
        This scenario also extends to other RadInput based controls like RadNumericTextBox. <br /><br /> 
         
        <br /> 
        Enter First name: 
        <br /> 
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="TextBox1" 
            ErrorMessage="*" EnableClientScript="true" runat="server" ValidationGroup="Save"></asp:RequiredFieldValidator> 
        <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2" 
            TargetControlID="RequiredFieldValidator2" /> 
        <br /> 
        Enter Surname: 
        <br /> 
        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="TextBox2" 
            ErrorMessage="*" EnableClientScript="true" runat="server" ValidationGroup="Save"></asp:RequiredFieldValidator> 
        <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3" 
            TargetControlID="RequiredFieldValidator3" /> 
        <br /> 
        Pick a date: 
        <br /> 
        <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
        </telerik:RadDatePicker> 
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="RadDatePicker1" 
            ErrorMessage="*" EnableClientScript="true" runat="server" ValidationGroup="Save"></asp:RequiredFieldValidator> 
        <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1" 
            TargetControlID="RequiredFieldValidator1" /> 
        <br /> 
        <br /> 
        <asp:Button ID="Button1" runat="server" Text="Save" ValidationGroup="Save" /> 
    </div> 
    </form> 
</body> 
</html> 
 


Regards
Glyn

0
Rosen
Telerik team
answered on 09 Sep 2008, 01:37 PM
Hi Craig,

Indeed you are right in your observation but I'm happy to inform you that our developers has addressed this issue. I'm attaching the latest internal build (for a dev version of the build please submit a formal support ticket) to this forum post to try it out.

Best regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Craig Nicholson
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Craig Nicholson
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or