 悬赏园豆:20
                [已关闭问题] 
            
                    关闭于 2011-09-23 15:33
                悬赏园豆:20
                [已关闭问题] 
            
                    关闭于 2011-09-23 15:33
                 
        看了网上都说是在CellFormatting事件中设置,但是设置以后,发现刷新的很厉害,不知为何?求指教,我的代码:
            //if (e.RowIndex > -1)
            //{
            //    DataRowView drv = gridEmail.Rows[e.RowIndex].DataBoundItem as DataRowView;
            //    if (drv["T_Mail_ReadState"].ToString() == bool.TrueString) return;
            //    //如果未读设置字体加粗
            //    if (gridEmail.Columns[e.ColumnIndex].GetType() == typeof(DataGridViewTextBoxColumn))
            //    {
            //        gridEmail.Rows[e.RowIndex].DefaultCellStyle = ReadedMailRowStateCellStyle;
            //    }
            //}
你是在什么事件中写的代码
在CellFormatting事件中设置
我的问题主要是在这个上面gridEmail.Rows[e.RowIndex].DefaultCellStyle = ReadedMailRowStateCellStyle;
是不能这样用的,否则会出现列表一直刷新,需要属性:e.CellStyle,对样式进行设置