Gridview problem

T

Taoge

Hi, all

I tried to change the content in a cell when user click a button. the code
as following:

protected void Button1_Click(object sender, EventArgs e)
{
this.GridView1.SelectedIndex = 12;
this.GridView1.EditIndex = this.GridView1.SelectedIndex;
Label1.Text = this.GridView1.SelectedRow.Cells[0].Text;
this.GridView1.SelectedRow.Cells[2].Text="10";
}

Everything is OK except the content in Cells[2] does not change, and when I
click the button again, it changes this time and the cell becomes
unalterable.

How can I accept the change and keep the cell alterable.

thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,104
Messages
2,570,643
Members
47,246
Latest member
rangas

Latest Threads

Top