This is a migrated thread and some comments may be shown as answers.

Validate code in cell and values other cells

2 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 31 Aug 2016, 02:59 PM

Hi forum,

I would user gridview for lines of document.

The line has several field: Line No., Item No., Description, Unit Price and so on.

The user should edit Item No. field, after validate Item No.,

it should search Item from database and it values to description and Unit Price fields in this line.

What is the better way to accomplish this?

What event should I check to get Item No. Code and values other cells of current row?

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Sep 2016, 05:15 AM
Hello Dario,

Thank you for writing. 

RadGridView provides a convenient way to perform validation before data is committed to the underlying data source. You can validate data by handling CellValidating event which is raised by RadGridView when the current cell changes or when the cell loses input focus (when pressing Enter key). Canceling this event prevents the user from exiting the cell until a valid editor value is entered or the process is canceled. In the event you can access to the row and to other cells by the Row.Cells property.The RowValidating event can be used the same way to prevent the user from exiting the current row. Additional information is available here: http://docs.telerik.com/devtools/winforms/gridview/editors/data-validation

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Dario Concilio
Top achievements
Rank 2
answered on 01 Sep 2016, 06:19 AM
thanks, you were crystalline!
Tags
GridView
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Dario Concilio
Top achievements
Rank 2
Share this question
or