change the text of cells of a column

Discussion in 'ASP .Net' started by Billow, Nov 18, 2005.

  1. Billow

    Billow Guest

    Hello

    I'd like to change the text of cells of a column which
    has been set as a buttonColumn and bounded to a datafield.
    I have tried to change its texts with code,but met a setback. Beneath
    here is what I have tried:
    hyst=menuDataGrid.Items[theboundcolumm].Cells.Text;
    //------hyst=""----The returned string was empty, why?
    menuDataGrid.Items[theboundcolumm].Cells.Text="the words";
    //----The effect showed on the brower was the clicked link was
    disappearing. Why? And how can i do ??
     
    Billow, Nov 18, 2005
    #1
    1. Advertising

  2. Since it's buttonColumn, you should deal with button (inside the cell) rather
    than cell.

    LinkButton linkBtn =
    (LinkButton)menuDataGrid.Items[row_index].Cells[theboundcolumm_index].Controls[0];
    hyst = linkBtn.Text;

    HTH

    Elton Wang


    "Billow" wrote:

    > Hello
    >
    > I'd like to change the text of cells of a column which
    > has been set as a buttonColumn and bounded to a datafield.
    > I have tried to change its texts with code,but met a setback. Beneath
    > here is what I have tried:
    > hyst=menuDataGrid.Items[theboundcolumm].Cells.Text;
    > //------hyst=""----The returned string was empty, why?
    > menuDataGrid.Items[theboundcolumm].Cells.Text="the words";
    > //----The effect showed on the brower was the clicked link was
    > disappearing. Why? And how can i do ??
    >
    >
    >
     
    =?Utf-8?B?RWx0b24gVw==?=, Nov 18, 2005
    #2
    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. Replies:
    0
    Views:
    538
  2. Dung Ping

    Grouping cells in column

    Dung Ping, Jun 4, 2006, in forum: HTML
    Replies:
    4
    Views:
    407
    Dung Ping
    Jun 5, 2006
  3. Frank
    Replies:
    2
    Views:
    521
    BootNic
    Dec 7, 2006
  4. Bruce
    Replies:
    1
    Views:
    4,443
    Bruce
    Mar 5, 2008
  5. Joel Finkel

    Cells[].Text or Cells[].Controls[0]

    Joel Finkel, Sep 1, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    319
    Joel Finkel
    Sep 1, 2003
Loading...

Share This Page