0

I have a datagrid in a wpf application where AutoGenerateColumns="TRUE". I would like to set some or all of them to be required and invalidate if something is missing.

I was hoping there would be something like: dgrid.Columns(_DataTable.Columns("fname").Ordinal).required = TRUE

donL
  • 1,290
  • 3
  • 13
  • 37

2 Answers2

0

Is required used to specify that the value is required when editing a row? Validations are not done this way...

You can take a look here http://blogs.u2u.be/diederik/post/2009/09/30/Validation-in-a-WPF-DataGrid.aspx if this is what you need.

Noone
  • 395
  • 1
  • 4
  • 17
  • I am looking at this, but it hasn't helped me yet. Partially because the columns are auto generated. I will keep reviewing it to see if I can glean what I need from it. It certainly looks like it will help me in other situations though. – donL Mar 29 '13 at 17:23
-1

Handle the event

DataGrid.AutoGeneratingColumn Event

paparazzo
  • 44,497
  • 23
  • 105
  • 176