TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anthony Clarke
NA
127
0
Datagrid Please Help - Cant get it to work :(
Jun 7 2011 2:15 PM
Hey Guys, I'll try to explain it a little better.
String Category Will equal say "£29.00" at startup
But i cannot parse it into an Int because of the £
So if i try to substring category – string removePoundSign = category.substring(1, category.length – 1) it shows "29.00" which is what I want but then if i do the if statement
Then i turn that into an Int
Int myValue
Int32.TryParse(removePoundSign, out myValue)
If (myValue >= 20)
{ e.appearence.backcolor = colour.red;
}
It won't work because it's still looking at the grid and seeing "£29.00"
As i was saying I can remove the display format and get rid of the £ and it works but i was wondering whether there is a way of doing it and keeping the £
Thanks alot
private
void
gridView1_RowStyle(
object
sender, DevExpress.XtraGrid.Views.Grid.
RowStyleEventArgs
e)
{
GridView
View = sender
as
GridView
;
string
category = View.GetRowCellDisplayText(e.RowHandle, View.Columns[
"Creditamount"
]);
string
removePoundSign = category.Substring(1, category.Length - 1);
int
numValue;
Int32
.TryParse(removePoundSign,
out
numValue);
if
(numValue >= 90)
{
e.Appearance.BackColor =
Color
.Red;
e.Appearance.BackColor2 =
Color
.SeaShell;
}
}
Reply
Answers (
2
)
About silverlight
strings and characters