Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a simple Silverlight Application that has a Map control that shows a ESRI Tiled layer service and a Dynamic Layer service. The Dynamic Layer service is just called "Wells" and it has a "Date" column and "Gas_Percent" field that would be perfect to show in a Chart. Does anyone know how I can do this? I've been looking at these examples in below hyperlink (for LineSeries) (Silverlight Chart Examples) but I don't know how to use my Wells layer and Date and Gas_Percent columns in place of what they have. Can anyone help me on this?

Thank you in advance.

share|improve this question

Sorry for the delay.. this is how i did it C# code I have a method which executes a GP task that returns a graphics layer I iterate each graphic, create an observable collection and bind the observable collection to the data grid. there are other ways to bind but this worked for me when used with the chart Hope this helps

    // GP task that returns graphics
    public void Execute(object parameter)
        Geoprocessor getData = new Geoprocessor();
        getData.Url = "GP task URL...";
        getData.Failed += this.GP_Failed;
        getData.GetResultDataCompleted += this.GP_GetResultDataCompleted;
        getData.GetResultDataAsync(this.jobId, "parameter");            

    // The event raised when GP task successful
    void GP_GetResultDataCompleted(object sender, GPParameterEventArgs e)
        object attributeValue = null;

        // Internal class object
        CategoryAttributes categoryAttributes = new CategoryAttributes();

        if (e.Parameter is GPFeatureRecordSetLayer)
            GPFeatureRecordSetLayer gpLayer = e.Parameter as GPFeatureRecordSetLayer;

            // Create a new graphics layer
            GraphicsLayer graphicsLayer = new GraphicsLayer();
            graphicsLayer.ID = "GraphicsLayer";

            // Add the graphics to the graphics layer and an observable collection that is binded to a data grid
            foreach (Graphic graphic in gpLayer.FeatureSet.Features)
                CategoryAttribute categoryAttribute = new CategoryAttribute();

                attributeValue = g.Attributes.Where(x => x.Key.Contains("CategoryCount")).SingleOrDefault().Value;
                if (attributeValue != null)
                    categoryAttribute.Count = attributeValue.ToString();

                attributeValue = g.Attributes.Where(x => x.Key.Contains("CategoryValue")).SingleOrDefault().Value;
                if (attributeValue != null)
                    categoryAttribute.Value = attributeValue.ToString();

                attributeValue = g.Attributes.Where(x => x.Key.Contains("CategoryAmount")).SingleOrDefault().Value;
                if (attributeValue != null)
                    categoryAttribute.Amount = attributeValue.ToString();


            // Add to map

            // Bind data to data grid
            this.MyDataGrid.ItemsSource = categoryAttributes;

    // Internal classes for creating the observable collection
    internal class CategoryAttributes : ObservableCollection<CategoryAttribute>
    internal class CategoryAttribute
        public double CategoryCount { get; set; }
        public double CategoryValue { get; set; }
        public double CategoryAmount { get; set; }
share|improve this answer

I did a similar kind of thing some time back... this is what I did and by the way I did this for a featurelayer/graphics layer using ESRI ArcGIS API

Binding the feature/graphics layer attributes to a data grid (did not use the featuredata grid ESRI provides) Then bind a specific grid column to a chart. Infact the way I did was the user can click on a column and the chart would display that column (simple bar chart). So you click a different column the chart changes.

share|improve this answer

How exactly did you bind the feature layer to the Data Grid? I've added a regular Data Grid to my Silverlight App but have not figured out how to bind it to my feature layer

Moderator- I tried responding to user2294 response but it ends up displaying as an answer can you adjust this for me? thanks

share|improve this answer
This sample binds a featurelayer to a datagrid. – Kirk Kuykendall May 13 '11 at 19:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.