UserAddedRow with databinded grid

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Back
Top