4
如何在開發設置圖標圖像根據從數據庫如何包括DevExpress的數據網格
如何在開發設置圖標圖像根據從數據庫如何包括DevExpress的數據網格
以下是具體步驟返回值表示數據網格。
以上所有都可以在設計者中完成。然後在這裏做以下
private void gridView1_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
{
if (e.Column == colImage1 && e.IsGetData) {
string someValueFromDatabase = (string)gridView1.GetRowCellValue(e.RowHandle, colOne);
if (someValueFromDatabase == "a") {
//Set an icon with index 0
e.Value = imageCollection1.Images[0];
} else {
//Set an icon with index 1
e.Value = imageCollection1.Images[1];
}
}
}
的關鍵是處理CustomUnboundColumnData和repositoryItemPictureEdit。
這個解釋比我在DevExpress網站上發現的更直接 - 謝謝。 DevExpress可以使用一些像你這樣的作家。 – RobC 2012-11-07 17:41:35