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 7850793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:58:19+00:00 2026-06-02T18:58:19+00:00

this is my problem i have a DataGrid and this his source var Query

  • 0

this is my problem

i have a DataGrid and this his source

var Query = from a in m.Table1
                       join p in m.Table2
                       on a.Value1 equals p.Value1
                       join c in m.Table3 on a.Value2 equals  c.Value2 
           select new {
                        value1 = a.value1
                        value2 = p.value2
                        value3 = c.value3
                        value4 = a.value4

                      };
    <DataGrid AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="84,75,0,0"
 Name="Grid_Exmple" Width="478" Height="219" VerticalAlignment="Top" SelectionChanged="Grid_Exmple_SelectionChanged">
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding value1 }" Header="value1 " IsReadOnly="True" x:Name="dgrvalue1 "  />
                        <DataGridTextColumn Binding="{Binding value2 }" Header="value2 " IsReadOnly="True"  x:Name="dgrvalue2 " />
                        <DataGridTextColumn Binding="{Binding value3 }" Header="value3 " IsReadOnly="True"  x:Name="dgrvalue3" />
                        <DataGridTextColumn Binding="{Binding value4}" Header="value4" IsReadOnly="True"  x:Name="dgrvalue4" />
                    </DataGrid.Columns>

when we press on the DataGrid Selection Event

  private void Grid_Exmple_SelectionChanged(object sender, SelectionChangedEventArgs e)
  {
    Here I try To Get The properties 

i can see the properties in e.AddedItems but i cant cast it

    ((<>f__AnonymousType2<int,int?,decimal?,decimal?,string,string,string,int,string>)(((object[])(e.AddedItems))[0])).Value1

  }
  • 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-02T18:58:20+00:00Added an answer on June 2, 2026 at 6:58 pm

    At least two possibilities:

    1. Create a named type, fill the grid with that and then cast back to this type.
    2. Cast to dynamic and do whatever you want.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a small problem. I have this grid with a column: <data:DataGrid ColumnHeaderStyle={StaticResource
Here is the problem: I have datagrid binded with data acquired from web service
i have a Problem to send a value from the DataGrid to a function-
I have this problem I'm using DataGrid + dojo.store.JsonRest as store. I want to
I've seen that a few instances of this problem have been raised already. However,
NOTE: I have solved the majority of this problem but have run into a
I've searched google and SO for a solution to this problem but have not
Ok I have this problem that I've never had before, it's really bugging me.
Ok I have this problem I'm trying to use Jquery to load a partial
So I have this problem with strings and switch-case, and I'll try to keep

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.