Posted 31 May 2018, 1:43 am EST
Hi,
To solve the issue related to FilterChanging event. You need to implement IBindingListView interface in your EmployeePreviewList class and set the SupportsFiltering property to true as:
public class EmployeePreviewList : BindingList<EmployeeViewObject>, IBindingListView
{
public EmployeePreviewList(int CompanyID)
{
for (int i = 0; i <= 10; i++)
{
EmployeeViewObject obj = new EmployeeViewObject();
obj.EmployeeId = i;
obj.Code = "Code" + i.ToString();
obj.Reference = "Reference" + i.ToString();
obj.LastName = "LastName" + i.ToString();
obj.FirstName = "FirstName" + i.ToString();
obj.MiddleName = "MiddleName" + i.ToString();
obj.NickName = "NickName" + i.ToString();
this.Add(obj);
}
}
public string Filter { get ; set ; }
public ListSortDescriptionCollection SortDescriptions => throw new NotImplementedException();
public bool SupportsAdvancedSorting => throw new NotImplementedException();
public bool SupportsFiltering => true;
public void ApplySort(ListSortDescriptionCollection sorts)
{
throw new NotImplementedException();
}
public void RemoveFilter()
{
}
}
Hope, it will solve your issue.
Thanks,
Singh