R
Ray
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
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