Datagrid Control - manipulate data displayed in column

Discussion in 'ASP .Net Web Controls' started by Ray, Jul 23, 2003.

  1. Ray

    Ray Guest

    I would like to edit the contents of a datagrid column
    before it is displayed. Relatively new - not sure what
    to do. Here is what I tried. The REPLACE is causing the
    problem (the second sql statement works fine and the grid
    displays field2 as is in the table). I would like to
    intercept field2 and change its value in certain cases
    before it is displayed in the grid. Can I do this?

    'sSQL = "SELECT Field1, REPLACE
    ([Field1],'Test1','Test2'), Field3 FROM Table1"

    sSQL = "SELECT Field1, Field2, Field3 FROM Table1"

    cmd.CommandText = sSQL
    rdr = cmd.ExecuteReader(CommandBehavior.Default)
    grdResults.DataSource = rdr
    grdResults.DataBind()
    rdr.Close()

    Thanks for your help.
    Ray
     
    Ray, Jul 23, 2003
    #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. Replies:
    2
    Views:
    769
  2. Dave
    Replies:
    1
    Views:
    346
    Mike Wahler
    Jan 22, 2005
  3. hudhu_handhu
    Replies:
    0
    Views:
    439
    hudhu_handhu
    Feb 19, 2007
  4. boney
    Replies:
    1
    Views:
    604
  5. Paul D. Fox

    Need to manipulate a column before displaying

    Paul D. Fox, Sep 19, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    105
    Paul D. Fox
    Sep 23, 2005
Loading...

Share This Page