Re: Programmatically changing text in a BoundColumn in a DataGrid?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Jul 28, 5:12 am, "Jen" <n...@xxxxxxxxxxx> wrote:
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

.



Relevant Pages

  • REPRESENT revisited
    ... Forth-94 has few floating point display functions [none in the ... If u is greater than zero the character string shall consist ... If u is zero the string shall consist of one digit representing ...
    (comp.lang.forth)
  • Re: List Vs Combo and Null values
    ... value to "" (a zero length string) simply because a ListBox and ComboBox ... values display the word "CAN" but when I convert it to a Combo Box (to ... from macros because this report is shared and macros locked out by ...
    (microsoft.public.access.reports)
  • Programmatically changing text in a BoundColumn in a DataGrid?
    ... I want to override the ... number if it is zero and display a string instead. ...
    (microsoft.public.dotnet.framework.aspnet)
  • (null) in Data Grid
    ... How do I get the Data Grid to display a zero length, "", string instead of ...
    (microsoft.public.dotnet.languages.vb)
  • Re: A Simple BMP Converter
    ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal ... Private Sub cmdSysInfo_Click ... Open Registry Key ... > color bar in the color display. ...
    (comp.lang.basic.visual.misc)