I have 2 questions:
1- We all know that can create an array list full of some employee objects and bind a datagridview to it.
but is that way have some advantages to other ways?
2- using the way above, how can we get the employee object info when a user clicks on a row of the datagridview?
thank you
Binding the grid to a strongly typed object rather than something like a DataTable helps reduce the errors in your code when you need to work with the object because of the compiler checks. In order to get the strongly typed object when a user clicks on row you can use the RowEvent as shown below: