解决方案 »

  1.   

    选择的事件有问题 ,可以在 CustomDrawCell事件中实现
      

  2.   

    我在使用这个函数的时候发现,我24行的数据加载进去之后(datasource绑定到数据源),RowSytle事件被引发了400多次,如何才能有效避免这种情况发生呢。
      

  3.   

    2L办法正解
    if (e.Column.FieldName == "Disabledate")
                {
                    if (kpi.Disabledate> DateTime.Today)
                    {
                        e.Appearance.BackColor2 = Color.PaleGreen;
                    }
                }/if (e.RowHandle > -1)
                //{
                //    if (_userrole != null)
                //    {
                //        if (_userrole.Disabledate > DateTime.Today)
                //        {
                //            e.Appearance.BackColor = Color.Red;
                //        }
                //    }
                //}