Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1084981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:37:51+00:00 2026-05-16T22:37:51+00:00

I am looking for information on how to provide data to DataGrid using Dictionary.

  • 0

I am looking for information on how to provide data to DataGrid using Dictionary. My use case is: I have WebService that provides me a table with the content (and column names) I get know in runtime.

My current implementation of a data tuple is:

 public class GridTuple : Dictionary<string, string>
    {

    public GridTuple(IDictionary<string, string> cv, int id) : base(cv)
    {               
        TupleId = id;
    }

    public int TupleId { set; get; }

    public override string ToString()
    {

        string result = TupleId + " ";
        for (int i = 0; i < ColumnNames.Names.Count; i++)
        {
            result += ColumnNames.Names[i] + " " + this[ColumnNames.Names[i]] + " ";
        }
        return result;

    }
}

…and implementation for DataGrid in xaml is:

<sdk:DataGrid AutoGenerateColumns="True" HeadersVisibility="All" x:Name="dataGrid"
                   HorizontalAlignment="Left" VerticalAlignment="Top"                          

                    ItemsSource="{Binding ListOfGridTuples}" MouseLeftButtonUp="dataGrid_MouseLeftButtonUp" 
                          SelectionMode="Single" Grid.Column="1" >

                <sdk:DataGrid.Columns>
                       <!-- ValueForColumn1 is a key in my GridTuple -->
                    <sdk:DataGridTextColumn Binding="{Binding [ValueForColumn1]}" />
                </sdk:DataGrid.Columns>

 </sdk:DataGrid>

…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:37:51+00:00Added an answer on May 16, 2026 at 10:37 pm

    Solved. I have found this post – http://blog.bodurov.com/How-to-Bind-Silverlight-DataGrid-From-IEnumerable-of-IDictionary/. I have created Columns with Bindings following this post. Only change I made was to put a ids of columns in Bindngs in ‘[‘ ‘]’ because SL4 provides support for dictionaries in xaml: new DataGridTextColumn { Header = “ID”, Binding = new Binding(“[ID]”) });

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking to create a database table that saves user information (primarily user and password).
I am looking for information about providing a license, or terms of use, for
I am looking for information on using a treeview in safethread manner. Does any
I have done some searches looking for information about how to do logging with
I was just looking through some information about Google's protocol buffers data interchange format.
I have a C#.Net application that accesses data from a commercial application backed by
I have a table that defines the possible categories in my website - fields
I'm looking into creating an Web or iPad application that will use HTML5. After
I'm looking for information [I hesitate to infer Best Practices] for Automating Applications. I'm
It may not be a pure programming question but I'm looking for information about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.