dotnet / dotnet/dotnet-api-docs

DataGridView.UserDeletedRow event has no DataBoundItem

Open
#2,266 0 comments 1 reaction 0 assignees View on GitHub
area-WinForms Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

When the UserDeletingRow event (which can be cancelled) is raised, the Row has a DataBoundItem.
When the UserDeletedRow event (which cannot be cancelled) is raised, the Row has an Index of -1 (reasonable), but the DataBoundItem is already null.
There is no property in the event that acts as a substitute.

This means that the only way to get a reference to a successfully deleted item (say to use it in DeleteObject in EF6) is to handle both events.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.