Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
Custom validtor
posted

Hi,

I'm Using infragistics version 8.2  for framwork 3.5

How to use custom validator for webcombo in asp.net 3.5.

Thanks in advance,

 

Parents
No Data
Reply
  • 2167
    posted

    If all you are looking for is that the user types in a value = to a value in your list... 
    Use a custom validator with this as your validation function:

    function ValidateCombo(oCombo,ColIndex) {
        try {  

            var grid=oCombo.getGrid();
            var rowCount=grid.Rows.length;
            var currVal='';
            var comboText=oCombo.displayValue;

            for(i=0;i<rowCount;i++){
              var row=grid.Rows.getRow(i);
              currVal=row.getCell(ColIndex).getValue();
              if (currVal == comboText) {
                return true;
              }   
            }
            return false;
        }   
        catch ( err ) {
            var txtMessage = document.title + " - Error in ValidateCombo()\n" + err.description ;
            alert( txtMessage ) ;
        }  

    }

Children
No Data