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

validatorcalloutextender on radgrid filter

0 Answers 23 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
chandan singh
Top achievements
Rank 1
chandan singh asked on 28 May 2012, 11:19 AM
Hi team,
Is it possible to apply validatorCalloutExtender on radgrid filter textbox? Here in below code (for reference only) i applied validatorCalloutExtender on TextBox.When error comes then one small pop window is open with error message and textbox border become red.Can we do same thing with radgrid filter textbox, when user trying to search with  wrong filter criteria?
Now i am able to show error message with the help of  javascript. please see "function ValidateFilter(sender, eventArgs)".
But i want to show error message as it is coming on TextBox.

function ValidateFilter(sender, eventArgs)
           {
            var arguments = eventArgs.get_commandArgument().split("|");
            var columnName = arguments[0];
            var valueEnteredIntoFilterControl = arguments[1];
           
            if (columnName == "YearsOfWorkExp")
            {
                if (isNaN(valueEnteredIntoFilterControl))
                {
                    var alertsay = "Please enter a numeric value";
                    alert(alertsay);
                    eventArgs.set_cancel(true);
                     
                }
            }
            else if (columnName == "FormattedName")
            {
 
                if (valueEnteredIntoFilterControl != "")
                {
                    if (/[^A-Za-z]/.test(valueEnteredIntoFilterControl)) {
                        alert("Please enter only letters in candidate name search filter");
                        valueEnteredIntoFilterControl.focus();
                         
                        eventArgs.set_cancel(true);
                    }
                }
 
            }
            
 
 
        }


<asp:TextBox ID="txtJobTitle" runat="server" CssClass="ven_box_txt"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="JobDescription"
                        ControlToValidate="txtJobTitle" Display="None" ErrorMessage="Job Title is required"
                        SetFocusOnError="True"></asp:RequiredFieldValidator>
                    <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender14" HighlightCssClass="errorHighLight"
                        TargetControlID="RequiredFieldValidator2" SkinID="TopLeftVCE" runat="server">
                    </cc1:ValidatorCalloutExtender>

No answers yet. Maybe you can help?

Tags
Ajax
Asked by
chandan singh
Top achievements
Rank 1
Share this question
or