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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:36:21+00:00 2026-05-13T14:36:21+00:00

I have a list of object bound to a DataGrid in a WPF page

  • 0

I have a list of object bound to a DataGrid in a WPF page and I am looking to add an object directly after the current one if the value entered in a specific column is less than a certain number.

<my:DataGridTextColumn Binding="{Binding Path=Hours}"/>

I cannot for the life of me figure out how to bind to an event on the underlying TextBox. Various sites reference the ability to do this but none provide the associated code. For now I have been using a DataGridTemplateColumn with a TextBox inside of it but I don’t seem to the able to get the current row with that solution.

  • 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-05-13T14:36:22+00:00Added an answer on May 13, 2026 at 2:36 pm

    To accomplish this I used the CellEditEnding event on the data grid itself.

    this.TheGrid.CellEditEnding += new EventHandler<DataGridCellEditEndingEventArgs>(TheGrid_CellEditEnding);
    

    In the method you can then use a Dispatcher to delay the call to a method so the value is stored back in the bound object.

    private void TheGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
    {
        Dispatcher.BeginInvoke(new Action(this.CellEdited));
    }
    

    You can also pass the DataGridCellEditEndingEventArgs to the method to allow you to inspect the row and column of the cell that was edited along with the underlying TextBox.

    Also since the data grid is concerned about objects the row index is not too relevant and therefore not easily obtainable (that I could find).

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

Sidebar

Related Questions

I have a dataGrid bound to a List object and this works fine by
I have a Generic List object which hold below table as its own value.
I have a List<T> collection which is bound to a DataGrid. T is some
I have bound my datagrid to a list. I am following Repository pattern and
I have a datagrid, bound to a List: <DataGrid HorizontalAlignment=Left SelectedItem={Binding CurrentPlayer} Height=374 Margin=121,22,0,0
I have 2 silverlight controls on a form; datagrid which is bound to list
Picture the following scenario: I have a DataGrid which I've bound to a list
I have a DataGridView object to which I've bound a list of objects (of
I have a repeater that is bound to a List(of T) object collection. It's
I have a ComboBox with a list of objects bound to it. Currently i

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.