Click here to Skip to main content
16,011,993 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a datagridview in that slno textbox,startno textbox,noofcheques combobox and endingno,status.I have create while design time.Now i want is when i click add button add blank row at top of the of the datagridview.Please help me on this.i have tried this code getting slno column could not be found.Thanks in advance.

What I have tried:

private void btnadd_Click(object sender, EventArgs e)
        {
            DataGridViewRow row = new DataGridViewRow();
            row.Cells["Slno"].Value = null;
            row.Cells["startno"].Value = null;
            row.Cells["noofcheques"].Value = null;
            row.Cells["endingno"].Value = null;
            row.Cells["Status"].Value = null;
            dgvwChqs.Rows.Insert(0, row);
           
        }
Posted
Updated 12-May-17 1:01am

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