First, start with two objects.
Object
{
int id {get; set;}
string description {get; set;}
}
ObjectName
{
int id {get;set;}
string name {get;set;}
}
Let’s say I have your average gridview:
List<Object> = GetListOfObjects();
MyGridview.DataSource = List<Object>;
But I want one of the columns to come from the list of names, where the ids are the same.
Psuedocode:
the ID column from MyGridview = List<ObjectNames>.Where(x=> x.id = myGridview.Id);
So basically, replacing the column of IDs with the column of names with those ids.
Is that possible to do? How would I approach this?
You need to make the data one datasource. You can create an anonymous type that will hold data from both collections.