4
我XtraGrid中有一個自定義風格的EventListener:的DevExpress XtraGrid中的自定義RowCellStyle事件處理和列排序問題
FooGridView.RowCellStyle += new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(FooGridView_RowCellStyle);
private void FooGridView_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView vw = (sender as DevExpress.XtraGrid.Views.Grid.GridView);
try
{
DataRow DR = vw.GetDataRow(vw.GetRowHandle(e.RowHandle));
if (**some condition based on one or more values in the DataRow**)
{
e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Strikeout);
e.Appearance.ForeColor = Color.LightGray;
}
else
{
e.Appearance.Font = new System.Drawing.Font(e.Appearance.Font, System.Drawing.FontStyle.Regular);
e.Appearance.ForeColor = Color.Black;
}
}
catch (Exception ex) { }
}
單擊網格列標題訴諸電網後,格式化結束後應用到錯誤行行已被重新排序。如何解決這個問題?
感謝您指出了額外轉換步驟中的錯誤。 – Tim
很高興幫助你出Tim! – Armbrat