Click here to Skip to main content
15,884,743 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the best way to add a row in Datagrid. I am using

AddClass data = new AddClass(234,"ABC");
            dgtest.Items.Add(data);


Method to add row with data in datagrid. But its not working. When i click on button to add row, it adds row with checkboxes not with the data i added in data variable. Why checkboxes are apearing.

AddClass:
C#
class AddClass
   {
       public int Acol { get; set; }
       public string Bcol { get; set; }

       public AddClass()
       {
       }



       public AddClass(int a, string b)
       {
           this.Acol = a;
           this.Bcol = b;
       }
   }



And Also tell me the best way to get data from each cell of datagrid.
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900