Mutlu Duman

Mutlu Duman

  • NA
  • 180
  • 5.3k

Advanced Filter

Dec 19 2019 3:01 AM
  1. if (colFilter.Contains(" IN ") == true )  
  2.                 {  
  3.                     var temp1 = colFilter.Trim().Split(new string[] { "IN" }, StringSplitOptions.None);  
  4.   
  5.                     colName = GetStringBetweenChars(temp1[0], '['']');  
  6.   
  7.                     var filterValsList = temp1[1].Split(',');  
  8.   
  9.                     newColFilter += string.Format("({0} != null && (", colName);  
  10.   
  11.                     string orOperator = "";  
  12.   
  13.                     foreach (var filterVal in filterValsList)  
  14.                     {  
  15.                         double tempNum = 0;  
  16.                         if (Double.TryParse(filterVal, out tempNum))  
  17.                             newColFilter += string.Format("{0} {1} = {2}", orOperator, colName, filterVal.Trim());  
  18.                         else  
  19.                             newColFilter += string.Format("{0} {1}.Contains({2})", orOperator, colName, filterVal.Trim());  
  20.   
  21.                         orOperator = " OR ";  
  22.                     }  
  23.   
  24.                     newColFilter += "))";  
  25.                 }  
  1. My Friends, When I Enter As Male Female I Have A Problem With Filtering Sex

Answers (1)