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
755
OnEditModeEnded validate if row is fullfilled
posted

Hi

I have XamDataGrid and if user leave the cell without fullfilled the whole row, then it should jump to the next empty cell, that the user  have to  fill it with data. until the is fullfiled.

To clarify the scenario, consider the attached picture. I want to force user, that he/she can not leave the row until is fullfile, in my case User and Password field.

Thanks so much.

  • 34810
    Verified Answer
    Offline posted

    Hello Jean-Pascal,

    To prevent a user from leaving a record in XamDataGrid until the record has been completely filled with data, and also have the cells jump back to empty editors, I would recommend handling the RecordDeactivating event of the XamDataGrid.

    In the event handler, set a new DataRecord to e.Record to get the record to be deactivated. Then, using a foreach loop, you can loop through each Field F in the DataRecord.FieldLayout.Fields collection. In the loop, call CellValuePresenter.FromRecordAndField(DataRecord, CurrentForeachLoopField) and if the CellValuePresenter’s value = null, call CellValuePresenter1.StartEditMode(), e.Cancel = true, and break.

    I have attached a sample application to demonstrate the above.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Developer Support Engineer I
    Infragistics Inc.
    www.infragistics.com/support

    XDGValidationCase.zip