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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:52:04+00:00 2026-06-14T18:52:04+00:00

I have a WPF data grid with multi select (SelectedMode = Extended). Each item

  • 0

I have a WPF data grid with multi select (SelectedMode = Extended). Each item has an IsSelected binding per https://stackoverflow.com/a/2615487/284795

<DataGrid 
ItemsSource="{Binding Items}"
SelectionUnit="FullRow"
SelectionMode="Extended"
SelectedIndex="{Binding SelectedIndex}"
SelectedItem="{Binding SelectedItem}">
    <DataGrid.RowStyle>
        <Style TargetType="DataGridRow">
            <Setter Property="IsSelected" Value="{Binding IsSelected}" />
        </Style>
    </DataGrid.RowStyle>
</DataGrid>

I’m curious. How do the properties SelectedIndex and SelectedItem on the DataGrid now behave? If two items are selected in the data grid, which one does SelectedItem point to?

Also, if all these bindings are two way, and I make a change to one from a view model, will the others be updated? (I’m observing a bug in my app perhaps because of this)

  • 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-14T18:52:06+00:00Added an answer on June 14, 2026 at 6:52 pm

    I had the same question a while ago, and I checked: I created a DataGrid with several items and set the SelectedMode = Extended, and I mde a binding to both: SelectedItem and SelectedIndex properties.

    The result was this: When you select a single item, and then you select other items and make a multiselect, the SelectedItem and SelectedIndex properties will be the first item that you selected. So when you make multiselects the selected item will be the first one you selected.

    Also all other selected items will be in the SelectedItems collection, that is read only (like in the question you pointed said) and it is not a dependency property, so you can’t make bindings to it. So if you want take all selected items, you need to handle the selection changed event of the DataGrid and then, manually, add and remove the new and old items from the collection that you want to keep (selected items).

    Hope my answer be clear enough, and it could helps you…

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

Sidebar

Related Questions

I have a WPF data grid and an xmlString and am having problems binding
I am a beginner to WPF . I have a data grid for showing
Is it possible to have a pure hierarchical wpf data grid? Now there are
I have created a data grid in WPF and have 2 lists. I want
I have a WPF Data Grid bound to an observable collection, which is working
I have a WPF Data Grid (From the WPF Toolkit as the title indicates)
I am using WPF datagrid. Data I am binding to the grid is not
Is it possible to have a WPF Toolkit Data Grid's DataGridComboBoxColumn exposed when the
I have a data grid in my WPF application window, which I have to
I have a .Net 4.0 WPF application using a data grid. Currently after sorting

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.