forum

Home / DeveloperSection / Forums / How to update a existing DataGridView cell

How to update a existing DataGridView cell

Mark Mak179714-Nov-2016
Dear All,
I am having a problem on how to updating an existing DataGridView Cell.

Class PTree
{   public string model {get; set;}
    public int location {get; set;}
    public int ploc {get; set;}
    public int cloc {get; set;}
    public int nloc {get; set;}
    public string name {get; set;}
    public string desc {get; set;}
   public PTree (string v1, int v2, int v3, int v4, int v5, string v6, string v7)
    {
        this.model = v1;
        this.location=v2;
        this.ploc=v3;
        this.cloc=v4;
        this.nloc=v5;
        this.name=v6;
        this.desc=v7;
    }
}

(model, location, ploc, cloc, nloc,     name, desc)
aaaaa,    1,               0,          1,       2,         n1,       n1desc
aaaaa,    1,                1,         2,      3,          n2,       n2desc
aaaaa,    1,                2,         3,      9999,   n3,      n3desc 
  mysql readin {
    ps.Add(new PTree(v1, v2, v3, v4, v5, v6,v7));
}
dataGrideView1.DataSource = ps;

I would like to update the third record   9999   to 4 by just click a btnUpdate.
 How could I do that?

Thanks!

Updated on 17-Nov-2016

Can you answer this question?


Answer

5 Answers

Liked By