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
225
Data entry grid
posted

I'm  making a form with four columns grid, in the first one i read a item using a  barcode reader, in the second one should show me the description of item and in the last two columns i will type numeric data.

I insert a wingrid in the form and select the data entry behavior int the designer

My questions are:

 

1) The barcode reader send a ENTER at end of the data and the wingrid jumps at next row, but i want to jump to the same row column index 2, ¿How can i do that?

2) Its correct use the BeforeCellUpdate to validate the data input?

Thanks in advance

Alejandro Castrejon

  • 69832
    Offline posted

    1) You can activate any cell by assigning a reference to that cell to the control's ActiveCell property. I think you can do this by handling AfterRowInsert (which gives you a reference to the row), activating the desired cell (for example, UltraGrid.ActiveCell = e.Row.Cells[2]), and then calling PerformAction(UltraGridAction.EnterEditMode).

    2) It depends on what kind of validation. You could handle BeforeExitEditMode and do it there (although note that the cell's value has not been committed at that point so you would use the cell.EditorResolved.CurrentEditText instead), which gives you the added ability of keeping focus in the cell if the validation fails (set the Cancel property of the event arguments to true).