This is a migrated thread and some comments may be shown as answers.

Comparison of the value of a cell

1 Answer 11 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vlad
Top achievements
Rank 1
Vlad asked on 05 Mar 2015, 10:08 AM
Hi.Why e.CellElement.Text or Value > "1" is working and e.CellElement.Value > 1 does not work? Sorry for my English. And what if you need to compare with a Double, but not with the String? CDbl tried that did not work.

1 Answer, 1 is accepted

Sort by
0
Vlad
Top achievements
Rank 1
answered on 05 Mar 2015, 10:21 AM
If e.CellElement.Value > "0.1" And e.CellElement.ColumnInfo.HeaderText <> "Current DateTime" Then
            e.CellElement.DrawFill = True
            e.CellElement.BackColor = Color.Pink
            e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
Working
If e.CellElement.Value > 0.1 And e.CellElement.ColumnInfo.HeaderText <> "Current DateTime" Then
            e.CellElement.DrawFill = True
            e.CellElement.BackColor = Color.Pink
            e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid
Error Visual Studio "An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll"
Tags
GridView
Asked by
Vlad
Top achievements
Rank 1
Answers by
Vlad
Top achievements
Rank 1
Share this question
or