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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:58:21+00:00 2026-06-08T15:58:21+00:00

I have a datagrid in a WPF project, and I am using the MVVM

  • 0

I have a datagrid in a WPF project, and I am using the MVVM pattern. I would like to be able to select multiple rows and in code, to know wich rows are selected. To do that, I set in the dataGrid the extended value to the selectionMode property.

I am using also MVVM light to convert the event selectionChanged to a command, and I pass the SelectedItems property as parameter.

I notice the following. When I select the first row with the mouse, in the slectionChanged method I receive one row, it’s ok. For example, this is the first row, for example.

Now, I press ctrl key and select the third row. In the event I receive 0 rows. If now I select the second row, then I receive 1 row, the second row.

So it seems that I only can receive the last row, but only if there is a continue block of rows, if I selected alternated rows, then I receive 0 rows.

How can I know the selected rows when I select alternate rows? And How can I know all the selected rows when I select a conitnue block of rows?

Thanks.

  • 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-08T15:58:25+00:00Added an answer on June 8, 2026 at 3:58 pm

    Make sure your Datagrid Property > SelectionUnit is Row

    .I hope this will help.

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

Sidebar

Related Questions

I am working on a WPF MVVM Project. Now i have a DataGrid in
I have a WPF project using MVVM. I have two views: ClientView and CommentView
I'm using a the WPF datagrid from the Microsoft CodePlex project. I have a
Problem I have a WPF Toolkit DataGrid , and I'd like to be able
I have a WPF datagrid control with a RowDetailsTemplate. I would like to be
I have quastion about DataGrid in WPF .NET 4. Here is XAML code with
I have a DataGrid (WPF Toolkit) with a custom combobox like edit template of
I am working on a project where I have implemented MVVM for WPF desktop
Here is the problem. I am using MVVM on a WPF project and using
i am developing a project (WPF) and i have a Datagrid the load more

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.