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
2430
Template error - how to trap
posted

I tried

try

{

       Template.Close(true);

}

catch

{

     // Handle Exception which it never hits

}

I also tried

try

{

Grid.UpdateData

}

catch

{

// again not hit

}

I have a dataset associated to the grid and as soon the Grid.UpdateData (or Template.Close(true) causes the grid to do an UpdateData to the datasource) it gives an error which does not appear to be trappable through try catch block.  The problem is the data in the RowEdit Template is invalid and causes a constraint violation.  I am not concerned about the violation, I want to catch the violation and handle it on the template close gracefully.  Is there a way of knowing before a template close or updatedata that there is a violation or capturing the violation?