I had a ObservableCollection
(fields like username,firstname,lastname,password,address,contact no etc) which contains a huge set of rows, and also I am having a datatable (columns like SNo, username,status) which is having a limited number of rows only.
Now what I need to filter the ObservableCollection
based on the usernames present in the datatable in the datatable and bind the ObservableCollection
to datagrid using linq.
I done a sample linq Query it does not produce exact data.
var res = from a in Settings.GetInstance().ObservableClass
where dtStatusTable.Rows.Contains(a.UserName)
select a;
Settings.GetInstance().ObservableClass = res as ObservableCollection<IObservableClass >;
Note: UserName
is unique and may be contains similar but not exact. Like usernames may be like Manikandan, Mani, ManikandanSekar etc.
Kindly give me a solution to filter the data.