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
あなたを助けてくれるのがティム! – Armbrat