validatorcalloutextender on radgrid filter

1 posts, 0 answers
  1. chandan singh
    chandan singh avatar
    10 posts
    Member since:
    Aug 2009

    Posted 28 May 2012 Link to this post

    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>

Back to Top