color devex xtragrid row for the data is greater than a value
when I tryin to color rows for a constraint value it makes because of the string value like this:
private void gvTerbiyedekiDispolar_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
GridView View = sender as GridView;
if (e.RowHandle >= 0)
{
string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["fire"]);
if (category == "0,10")
{
e.Appearance.BackColor = Color.LightGoldenrodYellow;
}
}
}
but if I try to "color the values greater than 0.1" it give me runtime error like this code
private void gvTerbiyedekiDispolar_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
GridView View = sender as GridView;
if (e.RowHandle >= 0)
{
double category = Convert.ToDouble(View.GetRowCellDisplayText(e.RowHandle, View.Columns["fire"]));
if (category > 0.10)
{
e.Appearance.BackColor = Color.LightGoldenrodYellow;
}
}
}
开发者_开发技巧what should I do ?
I replaced NULL values to 0 with ISNULL
and it is OK.
精彩评论