Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Change Text in DataGrid Cell
Message
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00672652
Message ID:
00672673
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
Not totally sure what you're trying, but...

I think the issue is that you are binding to an Integer column, and so you can't change the value to " ". What you can do is in your SELECT statement, have the statement do the conversion for you, then check for IsBlank() instead of 0 when doing the color.

Would that work in your case?

yag

>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform