Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 585
  • Last Modified:

Get current value of cell in bound datagridview

I have a bound (List of (object)) datagridview with one column that is editable. I need to get the current value of the edited cell. At the moment it either returns me the value from the underlying dataset or in a different editmode it updates the underlying dataset and therefore I don't know if the row has been edited. I don't want to update the whole object as this would be take too much time. What is the best way of handling this?
0
suroma
Asked:
suroma
  • 2
  • 2
1 Solution
 
Imran Javed ZiaCommented:
Hi,
you can use RowUpdated event if you want to get row index after update the object and here you can get changed values

alternatively you can use RowUpdating event and get can use e.rowindex to get grid row and then get related object and manually call update method.
Thanks
0
 
suromaAuthor Commented:
The datagridview does not have those events. The column being updated is a checkbox column.
0
 
Imran Javed ZiaCommented:
Sorry, I posted for GridView,
Anyhow you can use checkbox click event too for this purpose
0
 
suromaAuthor Commented:
OK I will. I should be able to check it out in a few days as this task has slipped down the priorities. Thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now