Hỏi đáp
Chia sẻ kiến thức, cùng nhau phát triển
Chào anh Long, cho em hỏi: Em đang làm chức năng Filter theo TENNHACUNGCAP mà khi chạy lên nó báo lỗi chỗ SupplierFilter:
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(lvSupplier.ItemsSource);
view.Filter = SupplierFilter;
private bool SupplierFilter(object obj)
{
if(String.IsNullOrEmpty(txtFilter.Text))
{
return true;
}
else
{
return ((obj as NHACUNGCAP).TENNHACUNGCAP.IndexOf(txtFilter.Text, StringComparison.OrdinalIgnoreCase) >= 0);
}
}
private void txtFilter_TextChanged(object sender, TextChangedEventArgs e)
{
CollectionViewSource.GetDefaultView(lvSupplier.ItemsSource).Refresh();
}
System.NotSupportedException: 'Specified method is not supported.'
Em không biết giải quyết thế nào. Xin anh giúp em
hình như từng bị,. thử bỏ vào invoke xem bạn