Hi all:
I have an EntityCollection, and i need to databind it to a grid for editing. I cannot databind it directly because previously i need to make some computations.
Imagine this:
public DataTable BuildComponents(EntityCollection<ComponentEntity> components)
{
DataTable ret = BuildComponents();
DataRow dr = null;
foreach (MixComponentEntity comp in components)
{
dr = ret.NewRow();
dr[Column1] = someComputation(comp.Field1);
dr[Column2] = otherComputation(comp.SerieData.Field1);
//SerieData is a related entity
...
ret.Rows.Add(dr);
}
return ret;
}
Well, i need, in some way, to generate a DataTable (or a TypedList) that is "binded" with original fields. For instance: I need to edit in the grid comp.Field1 value.
Many thanks, and Regards.