Hi,
I am unable to set inital string "Monday" to datagridview Combox in Defaultvaluesneeded in C#or
this leads to error popup
System ArgumentException: DatagridViewComboBoxCell value is not valid.
Please let me know your inputs .
Thanks in advance.
Thanks
Sudheer
This is the code
private void ProcurementDetailsDataGridView_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
{
e.Row.Cells["Type"].Value = "P";
e.Row.Cells["P1"].Value = 0;
}
{
this.Size = new Size(960, 477);
// TODO: This line of code loads data into the 'mySaleLDataSet.TransactionType' table. You can move, or remove it, as needed.
this.transactionTypeTableAdapter.Fill(this.mySaleLDataSet.TransactionType);
// TODO: This line of code loads data into the 'mySaleDataSet.ProductInformation' table. You can move, or remove it, as needed.
this.productInformationTableAdapter.Fill(this.mySaleDataSet.ProductInformation);
SetSupplier();
SaveStorageSingleButton.Enabled = true;
ProcurementDetailsDataGridView.AutoGenerateColumns = false;
//For Datatable
MyTable = new DataTable("ProductsDesc");
MyTable.Columns.Add("Product", typeof(string));
MyTable.Columns.Add("Type", typeof(string));
gridquantity.ColumnHeadersDefaultCellStyle.BackColor = Color.LightYellow;
ProcurementDetailsDataGridView.ColumnHeadersDefaultCellStyle.BackColor = Color.Red;
ProcurementDetailsDataGridView.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;
ProcurementDetailsDataGridView.ColumnHeadersDefaultCellStyle.SelectionBackColor= Color.LightSeaGreen;
ProcurementDetailsDataGridView.EnableHeadersVisualStyles =false;
}