开发者

color devex xtragrid row for the data is greater than a value

开发者 https://www.devze.com 2023-04-06 17:30 出处:网络
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.RowStyleEve

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消