Datagrid Control - manipulate data displayed in column

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
 

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
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top