mansi sharma 7 Junior Poster in Training

I want to add data to dataGridView.Mine code is as below-

protected void Page_Load(object sender, EventArgs e)
    {
        this.GridView1.rowcount = 3;
        this.GridView1.Rows[0].Cells[0].Value = "1";
        this.GridView1.Rows[0].Cells[1].Value = "11";
        this.GridView1.Rows[1].Cells[0].Value = "2";
        this.GridView1.Rows[1].Cells[1].Value = "22";
        this.GridView1.Rows[2].Cells[0].Value = "3";
        this.GridView1.Rows[2].Cells[1].Value = "33";
    }

Errors-1)'System.Web.UI.WebControls.TableCell' does not contain a definition for 'Value'

2)'System.Web.UI.WebControls.GridView' does not contain a definition for 'rowcount'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.