0

当我尝试为约束值着色行时,由于字符串值如下所示:

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;                   
            }               
        }
    }

但是如果我尝试“为大于 0.1 的值着色”,它会给我类似这段代码的运行时错误

 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;                   
            }               
        }
    }

我该怎么办 ?

4

1 回答 1

0

我将 NULL 值替换为 0ISNULL并且没关系。

于 2011-09-28T08:31:58.440 回答