Home Forums WPF controls Xceed DataGrid for WPF Driving validation from code

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

    Hello,

    Let’s get directly into the problem. I want to validate a row calling explicitly the “Validate” method of the CellEditorManager or override its “ValidateCore” method but I can’t it neither on CellEditors nor Column objects in the WPF assembly Xceed.WPF.DataGrid . How can I force the validation of a complete DataRow when a cell content has changed?

    Thanks,

              Greg

    Imported from legacy forums. Posted by Grégoire (had 2028 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Greg, 

    Can you give us more information on the reason why you need to validate the cells?

    The DataGrid can automatically reflect changes when cell content has changed by setting the UpdateSourceTrigger property to CellContentChanged:

        <xcdg:DataGridControl x:Name=”myGrid”  

                                Grid.Row=”1″ UpdateSourceTrigger=”CellContentChanged” … />

    Imported from legacy forums. Posted by Michel [Xceed] (had 398 views)

    User (Old forums)
    Member
    Post count: 23064

    My data row includes two fields where both of those fields can be left blank.  However, if they fill in the first field then they must fill in the second field also.  However, the validation error is not occuring after they fill in the first field and leave the second field blank.  I’m using the IDataErrorInfo interface and UpdateSourceTrigger=”CellContentChanged”.  How can I make it check validation on the second field after they finish editing the first field?

    Imported from legacy forums. Posted by Gregory (had 944 views)

    User (Old forums)
    Member
    Post count: 23064

    I am having this problem as well, and I’ve seen a couple similar posts where it has never been answered.

    I have two fields that I want to both show a validation error when either one of them causes an invalid state. Field B depends on Field A, so when either A or B changes and B becomes invalid, I want a red border to appear around both Field A and Field B.

    UpdateSourceTrigger is set to “CellContentChanged”. When I change Field A, the red border will appear on it, but not on Field B. That is, until I hit enter or add a new row, at which point the Row EditEnding event is triggered, and the red border appears on both A and B. I’d like this behaviour to occur as soon as Field A is changed, without having to click elsewhere or hit keyboard keys, but can’t figure out how to get it.

     

    Imported from legacy forums. Posted by Cynthia (had 109 views)

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