Created
March 3, 2017 06:25
-
-
Save hilapon/9ada9354b1bd5488fe37205301b565bd to your computer and use it in GitHub Desktop.
レコードのフィルタリングのサンプル(其の参)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Infragistics.Windows.DataPresenter; | |
using Infragistics.Windows.DataPresenter.Events; | |
/// <summary> | |
/// レコードのフィルタリング完了時のイベント | |
/// </summary> | |
private void XamDataGrid_RecordFilterChanged(object sender, RecordFilterChangedEventArgs e) { | |
// 保留中の変更を適用します | |
e.RecordFilter.ApplyPendingFilter(); | |
var presenter = sender as DataPresenterBase; | |
if (presenter != null) { | |
var records = presenter.Records.Where(record => { | |
if (record.IsDataRecord) { | |
var dr = ((DataRecord)record); | |
return !dr.IsFilteredOut.GetValueOrDefault(false); | |
} | |
return false; | |
}); | |
// 表示されてるレコード数 | |
Console.WriteLine(records.Count().ToString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment