原創(chuàng)|其它|編輯:郝浩|2012-10-30 13:32:35.000|閱讀 1172 次
概述:數(shù)據(jù)篩選是我們常用的功能,本文通過(guò)一個(gè)具體的事例為大家展示DevExpress XtraPivotGrid是如何實(shí)現(xiàn)對(duì)特定字段進(jìn)行數(shù)據(jù)篩選的。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
數(shù)據(jù)篩選是我們常用的功能,本文通過(guò)一個(gè)具體的事例為大家展示DevExpress 是如何實(shí)現(xiàn)對(duì)特定字段進(jìn)行數(shù)據(jù)篩選的。
下面的事例,目的是篩選出Country字段中含有 Brazil 或USA的數(shù)據(jù),代碼如下:
C#
using DevExpress.XtraPivotGrid; PivotGridField field = pivotGridControl1.Fields["Country"]; // Lock the control to prevent excessive updates when multiple properties are modified. pivotGridControl1.BeginUpdate(); try { // Clear the filter value collection and add two items to it. field.FilterValues.Clear(); field.FilterValues.Add("Brazil"); field.FilterValues.Add("USA"); // Specify that the control should only display the records // which contain the specified values in the Country field. field.FilterValues.FilterType = DevExpress.Data.PivotGrid.PivotFilterType.Included; } finally { // Unlock the control. pivotGridControl1.EndUpdate(); }
VB
Imports DevExpress.XtraPivotGrid Dim field As PivotGridField = PivotGridControl1.Fields("Country") ' Lock the control to prevent excessive updates when multiple properties are modified. PivotGridControl1.BeginUpdate() Try ' Clear the filter value collection and add two items to it. field.FilterValues.Clear() field.FilterValues.Add("Brazil") field.FilterValues.Add("USA") ' Specify that the control should only display the records ' which contain the specified values in the Country field. field.FilterValues.FilterType = DevExpress.Data.PivotGrid.PivotFilterType.Included Finally ' Unlock the control. PivotGridControl1.EndUpdate() End Try
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)