Using the below object StaffOut and binding it to a winGrid, I can update and delete winGrid rows but I can’t add rows. This is the error I'm receiving:
Additional information: Unable to add a new row. Underlying DataSource does not support adding new rows.
List<BEL_Employee> StaffOut = new List<BEL_Employee>();
StaffOut = DAL_Employee_Get.GetStaff();
ugPTOStaff.DataSource = null;
//ugPTOStaff.DataSource = bELEmployeeBindingSource;
ugPTOStaff.DataSource = StaffOut;
ugPTOStaff.DataBind();
After reading the online documentation I think what I am doing should work but apparently I’m missing something.
Any help you can provide would be appreciated.
Thank you.
Hristo:
Perfect. Thank you.
Hello,
List<T> doesn’t have AddNew(), which is needed for the grid to be able to create new object of type T and to add it to the collection, so instead of List<T> use BindingList<T>.
Please let me know if you have any further questions.