Dear Dominique & others,I tried the code you provided but could not get it to work. Below is my attempt:var flSource = featLyr.GraphicsSource;
var newSource = flSource.Join(this.elementListItems, fl => (int) fl.Attributes["OBJECTID"], db => (int) db.FID,
(fl, db) =>
{
var g = new Graphic {Geometry = fl.Geometry};
g.Attributes["Aloitusajankohta"] = db.Aloitusajankohta;
g.Attributes["Nimi"] = db.Nimi;
return g;
});
featLyr.GraphicsSource = (IEnumerable<Graphic>)newSource;
First problem: featLyr.GraphicsSource is null. I haven't yet investigated this further.I continued by taking the Graphics-collection of the feature layer instead of the GraphicsSource:var flSource = featLyr.Graphics;
Second problem: Debugger says "Graphics collection must be empty before using GraphicsSource." atfeatLyr.GraphicsSource = (IEnumerable<Graphic>)newSource;
Again, I skipped this and tried to simply access the graphic list to see if I got the attributes added. Third problem: cast (IList<Graphic>)newSource failed with the following error:"Unable to cast object of type '<JoinIterator>d__61`4[ESRI.ArcGIS.Client.Graphic,Boris2Entity.Osa_versio,System.Int32,ESRI.ArcGIS.Client.Graphic]' to type 'System.Collections.Generic.IList`1[ESRI.ArcGIS.Client.Graphic]'."At this point I gave up for the time being, I have to return to this tomorrow. In the meanwhile if anybody has any tips on this, they will - again - be very welcome...Regards,samuli n.