让RadGridView
拥有ImageColumn
如何为此Column
设置默认图片?
我正在使用
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
事件及其工作中调用此方法
有没有办法在没有代码的情况下设置默认图像?
答案 0 :(得分:0)
Mohamed尝试初始化datagrid,因为你应该有两件事 1-假行,所以你可以添加它并自定义它,它将被锁定 2-检查方法,以便在(添加,编辑,删除....等)
时跳过空行 private void Exercise_Load(object sender, EventArgs e)
{
dgvStudents = new DataGridView();
dgvStudents.Location = new Point(10, 10);
dgvStudents.Size = new Size(645, 100);
DataGridViewTextBoxColumn colFullName = new DataGridViewTextBoxColumn();
dgvStudents.Columns.Add(colFullName);
DataGridViewComboBoxColumn colGender = new DataGridViewComboBoxColumn();
dgvStudents.Columns.Add(colGender);
DataGridViewCheckBoxColumn colShowResume = new DataGridViewCheckBoxColumn();
dgvStudents.Columns.Add(colShowResume);
DataGridViewButtonColumn colShowPicture = new DataGridViewButtonColumn();
dgvStudents.Columns.Add(colShowPicture);
DataGridViewLinkColumn colEmailAddress = new DataGridViewLinkColumn();
dgvStudents.Columns.Add(colEmailAddress);
DataGridViewImageColumn colPicture = new DataGridViewImageColumn();
dgvStudents.Columns.Add(colPicture);
Controls.Add(dgvStudents);
}
答案 1 :(得分:0)
我通过添加获得目标
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;
页面加载