DataGridView Cannot Edit
-
I used following code to get data from my database
MyDBDataContext db = new MyDBDataContext(); var packages = from p in db.Packages blah blah blah.... dataGridViewPackages.DataSource = packages;
Although i can view data, i cannot edit data. I have also Enabled editing of the datagridview, but i cannot edit data why? thank you,Chatura Dilan
-
I used following code to get data from my database
MyDBDataContext db = new MyDBDataContext(); var packages = from p in db.Packages blah blah blah.... dataGridViewPackages.DataSource = packages;
Although i can view data, i cannot edit data. I have also Enabled editing of the datagridview, but i cannot edit data why? thank you,Chatura Dilan
Try creating a LinqDataSource that uses the MyDBDataContext.Packages table, enable updating on the LinqDataSource, and then bind that to the gridview.
-
I used following code to get data from my database
MyDBDataContext db = new MyDBDataContext(); var packages = from p in db.Packages blah blah blah.... dataGridViewPackages.DataSource = packages;
Although i can view data, i cannot edit data. I have also Enabled editing of the datagridview, but i cannot edit data why? thank you,Chatura Dilan
You can also insert commandfield in the DataGridView.