Programmatically changing text in a BoundColumn in a DataGrid?

J

Jen

I have a BoundColumn that displays a numeric value. I want to override the
number if it is zero and display a string instead. What's the easiest way
to do that?

Thanks in advance.
 
M

Masudur

I have a BoundColumn that displays a numeric value. I want to override the
number if it is zero and display a string instead. What's the easiest way
to do that?

Thanks in advance.

Hi...

in itemdataboud check the item you want to check and change the
value...

protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.Cells[6].Text == "0")
e.Row.Cells[6].Text = "Zero";
}

Thanks
Md. Masudur Rahman (Munna)
Kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top