Hiii Members,
I am working on a C# WinApp. In a form there are two ComboBoxes and one DataGridView. the first ComboBox contains customer names, the second ComboBox contains products (fruits, vegitables, house holds etc). I have wrote a code that some customers have pre-added products saved in a DataTable so, when I select the customer's name from ComboBox, the pre-saved products automatically loads into the DataGridView.
problem is when I try to add a new product for the customer, system throws error, "ColumnCount property cannot be set on a data-bound DataGridView control."
when remove the ColumnCount property, it throws another error, "Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound."
I have googled many times but no solution working for me. DataGridView.DataSource = null; will not work because I want to add more row in existing (pre-loaded) list.
Please show me anyway to add a row in a databound datagridview C# WinApp.
Thanks
Mayank Jani
Mayank JaniPosted Oct 8, 2019, 8:39 AM
Amit GuptaPosted Oct 4, 2019, 3:07 PM
Mayank JaniPosted Oct 4, 2019, 12:19 PM
Amit GuptaPosted Oct 4, 2019, 11:32 AM
Amit MohantyPosted Oct 4, 2019, 12:40 AM
Mayank JaniPosted Oct 3, 2019, 12:30 PM
Piyush PansuriyaPosted Sep 30, 2019, 12:47 AM