UserAddedRow with databinded grid

G

Guest

Hi, I need to set an ID when an user add a new row to my binded DataGridView,
so I'm using UserAddedRow event handler, to set it.
The problem is that the binded list isn't set, so I've the right value in
the cell but not in my object.

Binded list is a class that inherit from BindingList<> :

<code>
public class BindableList<T> : BindingList<T> where T : class
</code>

This is the code in my event handler :

<code>
private void dgvObjects_UserAddedRow(object sender, DataGridViewRowEventArgs
e)
{
dgvObjects.Rows[e.Row.Index].Cells["dgvcID"].Value =
Guid.NewGuid();
}
</code>

Do I need something else or I'm making mistakes ?

thanks
 

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