Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
610
IDataErrorInfo Row Border
posted

Hello,

I want to use the IDataErrorInfo interface and the xamdatagrid to show invalid records (rows) not cells. So basically if any business rules are violated, the object's IsValid will be false. When the objects IsValid is false, I want the grid to put a red border around the row. I do NOT want each cell border to be red, but rather I want the whole row to have a red border.

Is there a way to do this?

Thanks,

Jeff

Parents
No Data
Reply
  • 27093
    posted

    Hello Jeff,

     

    I have been looking into this and even though there is no built-in functionality I was able to modify the original template of the DataRecordPresenter, so you can achieve the desired result. What I had to do was to add a border around the whole record and check the HasDataError property to visualize it. I have put all this in a sample project for you (Grid_IDataError_row_border.zip) and have added comments in the xaml in capital letters only for your reference.

     

    Please let me know if you require any further clarification on the matter.

    Grid_IDataError_row_border.zip
Children