Link to home
Start Free TrialLog in
Avatar of suroma
suromaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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?
Avatar of Imran Javed Zia
Imran Javed Zia
Flag of Pakistan image

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
Avatar of suroma

ASKER

The datagridview does not have those events. The column being updated is a checkbox column.
ASKER CERTIFIED SOLUTION
Avatar of Imran Javed Zia
Imran Javed Zia
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of suroma

ASKER

OK I will. I should be able to check it out in a few days as this task has slipped down the priorities. Thanks.