制約値の行に色を付けようとすると、次のような文字列値が原因で作成されます。
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;
}
}
}
私は何をすべきか ?