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
310
Validation to stop the add new row template being displayed.
posted

I have followed the example in the following KB article.

http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=1747

 

My WinGrid has two columns, the first has a comboeditor to allow the user to select a value from a list. When the user exits the cell, the validation function is called and ensures that the value selected doesn't exist within another row within the grid, or is empty. When the focus is moved to the second cell, the row add template is displayed. This allows the user to fill in one of each of the columns to add another incomplete row below.

Is there a way to validate the entire row (or stop the template being displayed until both cells are validated), whilst returning the cursor to the incorrect cell within the row if the validation fails.

  • 469350
    Suggested Answer
    Offline posted

    You could do this in a couple of different ways. You could validate the whole row using the BeforeRowUpdate event or the BeforeRowDeactivate event. Either of these events can be canceled.You may also want to set the RowUpdateCancelAction property on the grid to determine what happens when BeforeRowUpdate is canceled.