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
305
problem adding new row at bindinglist<T>
posted

Hi i try to add a new row on top in my wingrid but i have problem. this is my code:

 

                    BindingList<MyObject> lis = new BindingList< MyObject >();

                    grid_Test.DataSource = lis;

                    grid_Test.DataBind();

 

        private void button1_New_Click(object sender, EventArgs e)

        {

            tab_Test.Focus(); 

            grid_Test.Focus();

            grid_Test.DisplayLayout.Bands[0].AddNew();

        }

 

and i have this error : " Row insertion not supported by this data source. " 

 

THANKS

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    BindingList<T> certainly supports row insertion. My best guess is that your MyObject class does not have a public, parameterless constructor and so the BindingList does not know how to create a new one.

Children
No Data