Hi,I want to achieve something similar as in ArcMap where you can examine all the attributes for each graphic. How would you achieve this in WPF ? Due to the fact that Attributes is a Dictionary<string, object> and lies underneath the Graphic. You can't easily bind to this and auto populate the grid. I'm looking into using IBindingList, but i was curious of somebody tried something similar before so i don't have to reinvent the wheel.In other words, did you created a DataGrid that has as columns each Attribute key and as each row the graphic with its values for that attribute key. knowing that the attributes are dynamic for different layers. If so, how did you do this.Thanks
DataTable dt = new DataTable(); if (layer.Graphics.Any()) { foreach (var attribute in layer.Graphics[0].Attributes) { dt.Columns.Add(attribute.Key); } foreach (var graphic in layer.Graphics) { dt.Rows.Add(graphic.Attributes.Values.ToArray()); } } this.Data = dt;
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.