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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:48:34+00:00 2026-06-19T01:48:34+00:00

How to tell if the entire row in DataGrid selected, or only a single

  • 0

How to tell if the entire row in DataGrid selected,

or only a single column

(by Binding or Command, I want to keep the principle of MVVM).

  • 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-19T01:48:36+00:00Added an answer on June 19, 2026 at 1:48 am

    Finally, I found a solution by myself.

    (Very Strange that I found nothing about it in a good search.)

    Here’s what I did:

    I put to two events of the DataGrid bind to Commands sitting in ViewModel.

           <i:EventTrigger EventName="BeginningEdit">
                <i:InvokeCommandAction CommandParameter="{Binding CurrentCell.Column.DisplayIndex, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Command="{Binding DataContext.ColBeginEdit, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
            </i:EventTrigger>
            <i:EventTrigger EventName="CellEditEnding">
                <i:InvokeCommandAction CommandParameter="{Binding CurrentCell.Column.Header, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Command="{Binding DataContext.ColEndEdit, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
            </i:EventTrigger>
    

    In the view model i invok two functions to the commands:

        public void CoulmnBeginEdit(object obj)
        {
            int i;
            if (Int32.TryParse(obj.ToString(), out i))
            {
                if (i > 0)
                   this.CurrentCellEdit = i;
            }
    
        }
    
        public void CoulmnEndEdit(object obj)
        {
            this.CurrentCellEdit = 0;
        }
    

    If CurrentCellEdit is greater than 0 sign that line editing, otherwise not.

    The row number I have on SelectedIndex, and according to the CurrentCellEdit I also know which column editing in the row.

    I was hoping to find a simpler way, but this is the only solution that came to mind, to keep the principle of MVVM, and I’m still trying ..

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

Sidebar

Related Questions

I need to Get the Entire Row values when I click on jquery grid
I need to style an entire column in a table. The column should correspond
How can I tell the paint method to draw background on JPanel only and
I want to tell my array to start from key position 2 and then
Currently to tell a cell not to flash blue when selected, I set the
I am refering Android ListView Refresh Single Row However, to use the above link
Can any one please tell a code for unchecking a entire check marks in
I was hoping someone could tell me how to bring an entire set of
I've been searching through the entire manuals and I can't find a single mention
I want to force ssl access on an entire site, except for the following

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.