C# 是否为图像列设置默认图像?
有C# 是否为图像列设置默认图像?,c#,winforms,telerik,radgridview,C#,Winforms,Telerik,Radgridview,有RadGridView其中有ImageColumn如何设置此列的默认图像? 我正在使用 private void setImageToColumns() { foreach (var row in dgv_AddJournal.Rows) { row.Cells["SearchAccount"].Value = Accounting.Genral.Properties.Resources._1396284460_system_
RadGridView
其中有ImageColumn
如何设置此列的默认图像?
我正在使用
private void setImageToColumns()
{
foreach (var row in dgv_AddJournal.Rows)
{
row.Cells["SearchAccount"].Value = Accounting.Genral.Properties.Resources._1396284460_system_search;
row.Cells["SearchCostCenter"].Value = Accounting.Genral.Properties.Resources._1396284460_system_search;
row.Cells["DeleteAccount"].Value = Accounting.Genral.Properties.Resources._1398281700_Gnome_Edit_Clear_64;
row.Cells["DeleteCost"].Value = Accounting.Genral.Properties.Resources._1398281700_Gnome_Edit_Clear_64;
}
}
我在PageLoad
和UserAddingRow
事件中调用此方法及其工作原理
有一种不使用代码设置默认图像的方法吗?Mohamed在初始化datagrid时尝试一下,因为您应该有两件事
1-伪造行,以便您可以添加和自定义它,它将被锁定
2-检查方法,以便在(添加、编辑、删除…等)时跳过空行
我通过添加
dgv_AddJournal.CurrentRow.Cells["SearchAccount"].Value = Accounting.Genral.Properties.Resources._1396284460_system_search;
dgv_AddJournal.CurrentRow.Cells["SearchCostCenter"].Value = Accounting.Genral.Properties.Resources._1396284460_system_search;
dgv_AddJournal.CurrentRow.Cells["DeleteAccount"].Value = Accounting.Genral.Properties.Resources._1398281700_Gnome_Edit_Clear_64;
dgv_AddJournal.CurrentRow.Cells["DeleteCost"].Value = Accounting.Genral.Properties.Resources._1398281700_Gnome_Edit_Clear_64;
页面内加载
dgv_AddJournal.CurrentRow.Cells["SearchAccount"].Value = Accounting.Genral.Properties.Resources._1396284460_system_search;
dgv_AddJournal.CurrentRow.Cells["SearchCostCenter"].Value = Accounting.Genral.Properties.Resources._1396284460_system_search;
dgv_AddJournal.CurrentRow.Cells["DeleteAccount"].Value = Accounting.Genral.Properties.Resources._1398281700_Gnome_Edit_Clear_64;
dgv_AddJournal.CurrentRow.Cells["DeleteCost"].Value = Accounting.Genral.Properties.Resources._1398281700_Gnome_Edit_Clear_64;