Gridview problem

Discussion in 'ASP .Net Web Controls' started by Taoge, Aug 16, 2006.

  1. Taoge

    Taoge Guest

    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!
     
    Taoge, Aug 16, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nalaka

    GridView in a GridView

    Nalaka, Nov 11, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    6,655
    Nalaka
    Dec 5, 2005
  2. Replies:
    3
    Views:
    5,148
  3. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,046
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  4. Vik
    Replies:
    1
    Views:
    541
  5. HeavyMetal

    GridView RowCommand problem: GridView Nested in Repeater

    HeavyMetal, Aug 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    944
    HeavyMetal
    Aug 8, 2006
Loading...

Share This Page