DataGrid - set value when row is added?

May 29, 2009 at 8:29 PM

I'm using the WPF datagrid. When he user loads up a page, the grid only has one empty row in it. when they click on the grid, I want to optionally (based on some business rules) set a default value on one or many columns in that row.

What event should I wireup so that I can access the entire row, in case I need to set multiple values?

Basically, what I'd like to know is what event fires when a row is added to the grid by clicking on the grid?

Note that I optionally do this each time, so I can't set the value in the column to start off with, and the default value can change too...



Jun 1, 2009 at 7:01 AM

InitializingNewItem and e.NewItem should be a good place to start.