DataView.RowFilter,多个列上的多个可能值
我有一个数据视图,其中interesting列是length、height、color1和color2,其中color1和color2可以是黄色、红色、蓝色、黑色、白色或绿色。应用过滤器的最佳方法是什么?在这里,我获得具有特定长度和高度的行,但只使用红色、蓝色和绿色 当可能的颜色变大时,下面的过滤器感觉有点“难看”:DataView.RowFilter,多个列上的多个可能值,filter,dataview,Filter,Dataview,我有一个数据视图,其中interesting列是length、height、color1和color2,其中color1和color2可以是黄色、红色、蓝色、黑色、白色或绿色。应用过滤器的最佳方法是什么?在这里,我获得具有特定长度和高度的行,但只使用红色、蓝色和绿色 当可能的颜色变大时,下面的过滤器感觉有点“难看”: “长度>10,高度>10和(color1='red'或color1='blue'或color1='green')和(color2='red'或color2='blue'或color
“长度>10,高度>10和(color1='red'或color1='blue'或color1='green')和(color2='red'或color2='blue'或color2='green')”
或者这是唯一/最简单的方法?不幸的是,这就是“SQL风格”查询的本质:) 子句中的
可能使该查询更简单:
"length > 10 AND height > 10 AND color1 IN ('red', 'blue', 'green') AND color2 IN ('red', 'blue', 'green')"