Manipulating a bound datagridview

K

korey99

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
 
V

VJ

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

Vijay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top