Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1205
WinGrid Add new rows
posted

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.

Parents
  • 48586
    posted

    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.  

Reply Children
No Data