Re: Manipulating a bound datagridview



Either way you do it, it is going to delete at the source.. because it is by
reference

Vijay

"korey99" <koreyatterberry@xxxxxxxxx> wrote in message
news:1146232165.070015.240130@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi-

I'm working on an application that has a datagridview bound to a
datatable, backed by an Access database, through a bindingsource. I
have buttons to add and remove rows, and handlers for those buttons.

My question is, what is the proper/commonly accepted way to (for
example) remove the currently selected row from this
datatable/datagrid? Should I go through the datagridview, the
bindingSource, or the datatable itself? I've gotten the following to
work:

DataRowView drv = (DataRowView)bindingSource.Current;
drv.Delete;

and

DataRowView drv = (DataRowView)dgvAttachments.CurrentRow.DataBoundItem;
drv.Delete;


Thanks,
Korey



.