Hi,
I am getting the error as Column name not found in following line:
if (Convert.ToBoolean(DGVOPDProc["Assign", i].EditedFormattedValue))
Where DGVOPDProc is the name of my Data Grid View Control and Assign is the column name.
on this basis i want to insert data in my table, can anyone have any other idea or can anyone have any idea to resolve this.
Thanks.
Loading
Piyush PansuriyaPosted Jan 9, 2015, 11:10 PM
Than accept as correct answer.!!
Posted Jan 9, 2015, 12:14 PM
Thanks @Piyush Sir.your suggestion is correct at its place.
Piyush PansuriyaPosted Jan 9, 2015, 3:51 AM
If you want to get column than :
Posted Jan 9, 2015, 2:48 AM
Following is my code :
for (int i = 0; i < DGVOPDProc.Rows.Count; i++)
{
if (Convert.ToBoolean(DGVOPDProc["Assign", i].EditedFormattedValue))
{
//Code for inserting the values selected in Grid View.
}
}
i is nothing but an integer variable. Assign is an CheckBoxControl Column in Data Grid View.
Piyush PansuriyaPosted Jan 9, 2015, 2:41 AM
Can I know what is "i" in your if condition?
if you put your full method, so i can suggest..