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

SetFocusOnError RadControls Ver 2008.2.804.20

4 Answers 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 02 Oct 2008, 06:17 PM
According to the thread at http://www.telerik.com/community/forums/thread/b311D-hmktb.aspx the assertion that the SetFocusOnError issues were fixed in the "Q2 2008" release.

Here's the post.

 -------------
Hi Justin,

The problem has been addressed for Q1 2008 SP1 version labeled 2008.1.515.

Please, give the latest Q2 2008 "Futures" build a try. You can read more about it here.

Greetings,
Konstantin Petkov
the Telerik team
---------

However I am using Ver 2008.2.804.20 and can't get the focus to go to the controls that I have tried (text box, date picker). So, which controls does
SetFocusOnError work on and how do you get it to work?

           <telerik:RadTextBox ID="State" runat="server" TabIndex="5" >
                    <FocusedStyle BackColor="#F1F6FC" />
                </telerik:RadTextBox>
 
                          <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                              ControlToValidate="State" Display="Dynamic" SetFocusOnError="True">Required 
                          </asp:RequiredFieldValidator>

Or
                      <telerik:RadDatePicker ID="rdpStartDate" runat="server"  DateInput-FocusedStyle-BackColor="#F1F6FC" ToolTip="Select Start Date" CssClass="inline"></telerik:RadDatePicker>
                     <asp:RequiredFieldValidator id="rfvStartDate" runat="server"
                     text="* Required" controltovalidate="rdpStartDate" validationgroup="validate"
                     initalvalue="" CssClass="inline" ErrorMessage="Required"
                     SetFocusOnError="True" ></asp:RequiredFieldValidator>
                     <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="rdpEndDate"
                    ControlToValidate="rdpStartDate" ErrorMessage="Start Date must be before End Date"
                    Operator="LessThan" SetFocusOnError="True" CssClass="block valCustom" ></asp:CompareValidator>

does not work for me.

I love your controls, but some times they are a pain.

Keith E.


4 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 03 Oct 2008, 08:04 AM
Hi Keith,

I am sorry to hear that you are having a hard time configuring the functionality to set focus in our input/date picker controls when the validation fails. Can you please check whether the issue persists in the latest release 2008.2.1001 of RadControls for ASP.NET AJAX announced a couple of days ago?

If the problem is still there, please let us know in order to investigate the matter further and provide up-to-the-point explanation/solution.

Kind regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Keith
Top achievements
Rank 1
answered on 05 Oct 2008, 11:54 PM
I upgraded to 2008.2 100 and the SetFocusOnError still doesn't work.

It is really frustrating to have a product that offers a stadard .NET function and not have it work. Then have the products vendor stat that the problem has been correct and it has not. It doesn't speak well of your quality control and effort to fix bugs. I have spend hours on something that should takes seconds to implement and still don't have a basic function working. I am not a happy camper.

Keith. E
0
Vlad
Telerik team
answered on 06 Oct 2008, 07:46 AM
Hi Keith,

I just tried this and everything worked fine on my end. You can check attached example.

Best wishes,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Keith
Top achievements
Rank 1
answered on 08 Oct 2008, 12:59 PM
Thanks for your quick reply.

I will check you example with the latest release and in our environment, when I have time. Right now I can't use the latest release of the Telerik controls because the app we are using your tools is in its final stages before production release and we don't want to change code without thorough integration testing.

That issue aside. I took a quick look at your example:

 <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:Button ID="Button1" Text="Button1" runat="server" />
            <telerik:RadTextBox ID="State" runat="server" TabIndex="5">
                <FocusedStyle BackColor="#F1F6FC" />
            </telerik:RadTextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="State"
                Display="Dynamic" SetFocusOnError="True">Required
            </asp:RequiredFieldValidator>
        </div>
    </form>

Although it looks straight forward, it doesn't explore all the various options that are available for the validation controls. Some exploration of the standard .NET controls used with validators have exposes some curious behaviors and iteractions. For example if you have a CssClass set for a .NET validator control, it seems to break the Display=Dynamic and the string set in the Text="" is displayed all the time and it is not dynamic. If you remove the CssClass, all works as expected. To apply a style the validator control needs to be wrapped in a style or div tag with a CSS class or you you need to put text between the opening and closing validator tags that is styled. It appears that adding a CssClass to the validator tag works in static mode and but not in dynamic.

So, I am not sure if its the configuration of the validator control that is defeating the SetFocusOnError behavior when it issued with the Telerik controls or something within our environment.

You may want to verify that the SetFocusOnError works with all possible permutations of the validator control options when used with your controls.

The basic example you provide might work, but what happens when a range of validator settings are implemented.

Food for thought!

Keith E.


Tags
General Discussions
Asked by
Keith
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Keith
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or