I have the following class in my C # .NET 3.5 win forms application:
class Field {
string objectName;
string objectType;
string fieldName;
string fieldValue;
}
and ListList List, which is the data source for the marked list. This list shows all the individual object names from my fieldList collection.
I want to create another checklistbox that contains field names, but only shows the names of the fields that have the associated verified name of the object in the first list.
So my question is, how can I query the data source of the original list of object names to return a separate set of field names associated with the selected objectName?
This is not very easy to read, so I will give an example:
Field1 {
objectName = 'objA'
FieldName = 'FieldA'
}
Field2 {
objectName = 'objA'
FieldName = 'FieldB'
}
Field3 {
objectName = 'objB'
FieldName = 'FieldA'
}
Field4 {
objectName = 'objC'
FieldName = 'FieldC'
}
So, suppose in my checkbox I select objectNames objA and objB. Then my returned fields will be "FieldA" and "FieldB".
LINQ ? "select" "where", ?