Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Change Text in DataGrid Cell
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Titre:
How to Change Text in DataGrid Cell
Divers
Thread ID:
00672652
Message ID:
00672652
Vues:
41
In the ItemCreated event I am changing the color of the cell based off the value, it will either return a zero (empty) or a number greater than zero (caseID). If it is zero, I change the cell backcolor to green otherwise I change it to red and populate the tooltip with what procedure is being done. On the ones where the value is zero, it displays the zero, I want to change that to be blank. It is just a standard datagrid with no properties set in the designer. Below is the code I have (don't change the text, but doesn't throw an error either).


If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
If Me.radio_AM.Checked Then
tempString = DataBinder.Eval(e.Item.DataItem, "T0600").ToString()
iValue = Integer.Parse(tempString)
If iValue > 0 Then
e.Item.Cells(1).BackColor = Color.Red
getCaseInfo(tempString, BarDesc)
e.Item.Cells(1).ToolTip = RTrim(BarDesc)
Else
e.Item.Cells(1).BackColor = Color.LightGreen
e.Item.Cells(1).Text = " "
End If
End If

Thanks for any help.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform