all groups > dotnet windows forms > april 2006 >
You're in the

dotnet windows forms

group:

Manipulating a bound datagridview


Manipulating a bound datagridview korey99
4/28/2006 6:49:25 AM
dotnet windows forms:
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
Re: Manipulating a bound datagridview VJ
4/28/2006 9:21:22 AM
Either way you do it, it is going to delete at the source.. because it is by
reference

Vijay

[quoted text, click to view]

AddThis Social Bookmark Button