I have a form that receives a list, to show on the screen and allow to choose, or even, to search in it, something simple to not use heavy and expensive controls like DevExpress
, the subject is the following:
The form receives the list, the names of columns and the size of columns, everything goes well, but now I have added a column that should be sent and that is the sum of all the previous fields, so that it can be done a search on that single column and the matching rows can be filtered.
This column I have called ItemString
and the linq goes like this:
private ICollection<dynamic> Listado;
...
var lista = (from i in this.listado
where (i.ItemString.Contains(sValorBuscado))
select i).ToList();
and throws me the error:
'object' does not contain a definition for 'ItemString' System.Collections.ListDictionaryInternal
How can this be done? How can this be avoided, given that the names of the columns are not known? In the debugging I see that if the ItemString
column arrives, but the linq does not seem to recognize it.