Home Forums WPF controls Xceed DataGrid for WPF Validation of InsertRow

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22462 |

    Maybe I missed something but –
    Is it possible to validate (cellvalidation or other) the cells in the insertion row? before the row gets inserted into the grid/source?

    Imported from legacy forums. Posted by MiddleTommy (had 3001 views)

    Xceed Support
    Member
    Post count: 5658

    The validation scheme that runs on DataRows when they are edited is also applied to the InsertionRow. The same validation rules are used.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 257 views)

    User (Old forums)
    Member
    Post count: 23064

    How do you set that up?
    I have a grid with an insertionrow and I set the cell validation rules as follows:

    dgStock.Columns[“size”].CellValidationRules.Add(new MyCards.Data.SizeValidationRule());
    dgStock.Columns[“type”].CellValidationRules.Add(new MyCards.Data.TypeValidationRule());
    dgStock.Columns[“grade”].CellValidationRules.Add(new MyCards.Data.GradeValidationRule());

    the insertion row does not validate anything at all.
    what am I doing wrong?

    Imported from legacy forums. Posted by MiddleTommy (had 413 views)

    User (Old forums)
    Member
    Post count: 23064

    Never Mind It was an error in my cell validator

    Imported from legacy forums. Posted by MiddleTommy (had 3676 views)

    User (Old forums)
    Member
    Post count: 23064

    Hello MiddleTommy,

     

    I know this is an old post but can you please let me know how you did that? I am trying to force my validation rules on the grid as soon as the items are added to the grid rather than having to click on the cell and tab out of it to fire the validation rule.

     

    Thanks,

    Sri

    Imported from legacy forums. Posted by srikanth (had 450 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry I gave up on insertion row a while back. Now I just have my users click ADD or press Ctrl-A to get a new row

    Imported from legacy forums. Posted by MiddleTommy (had 914 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.