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

  • SEARCH
  • Home
  • 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 9144877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:22:35+00:00 2026-06-17T10:22:35+00:00

I am new to C# and this is completely stumping me. I have a

  • 0

I am new to C# and this is completely stumping me. I have a WPF form with many textboxes that are used to to spatially represent the number of services required in each area (PropertyZone) of a map.

I can write a LINQ query that brings back all of my necessary data into a DataGrid, but I have been completely unable to access the data beyond that. I have attempted to dump the data into a DataTable, to no avail. I can see the data in the DataGrid, but I do not know how to iterate through the rows. I do not care if I use a DataGrid, DataTable, Collection or any other method to access the data. In stumbling around a Collection seems like it might be a good solution, but the use of inner joins and a count() seems to be my downfall.

There are two columns of data being produced:

Column1=PropertyZone 
Column2=CountOfServicesInThatPropertyZone

I want to look at Column1 Row1 and based on this value, dump the value from Column2 Row1 into a textbox with the same name as the value in Column1 Row1 and do this for all rows in each of the two columns.

This is the LINQ query that does work, but I have been completely unable to access the data.

var query =
      from o in con.ORDER_LINE_TABLEs
      join p in con.PROPERTY_TABLEs on o.PropertyNumber equals p.PropertyNumber 
      where o.ServiceNumber == 2
      group o by p.PropertyZone into g
      select new { PropertyZone = g.Key, CountOfServicesInThatPropertyZone = g.Count() };
ServiceDataGrid.ItemsSource = query;

I hope this is clear.

  • 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-06-17T10:22:36+00:00Added an answer on June 17, 2026 at 10:22 am

    If you want to access an item in particular, you have to run the query and store the results somewhere, for example inside a List. You can then bind the DataGrid to this same List:

    var query =
      from o in con.ORDER_LINE_TABLEs
      join p in con.PROPERTY_TABLEs on o.PropertyNumber equals p.PropertyNumber 
      where o.ServiceNumber == 2
      group o by p.PropertyZone into g
      select new { PropertyZone = g.Key, CountOfServicesInThatPropertyZone = g.Count() };
    
    var myList = query.ToList();
    
    ServiceDataGrid.ItemsSource = myList;
    
    var row1Col1Value = myList[0].PropertyZone;
    var row1Col2Value = myList[0].CountOfServicesInThatPropertyZone;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I searched SO before asking this question, I am completely new to this and
Completely new to most of this stuff, but basically Im playing around with the
I am completely new to iOS development so I may be doing this wrong
I'm completely new to ANTLR and EBNF grammars to begin with, so this is
I am completely new to Web Development, still a student. Kindly bare this extremely
I've been tackling this for a while. I setup a completely new machine. I've
I am new this sharepoint development and i have task in hand to do
At this moment we are building a new architecture that is based on the
If I have an array created like this: MyType *array = new MyType[10]; And
I have a method like this, that hangs when declaring responseObject using Task.Factory.FromAsync() private

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.