0

这是我编码的:

private void DeleteButton_Click(object sender, EventArgs e)
    {
        //Add column for status
        DataGridViewImageColumn imageColumn = new DataGridViewImageColumn();
        imageColumn.Name = "ImageColumn";
        imageColumn.HeaderText = "Status";
        FilesDataGridView.Columns.Add(imageColumn);
        FilesDataGridView.Columns[2].Width = 45;

        foreach (DataGridViewRow dr in FilesDataGridView.Rows)
        {
            DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)dr.Cells["ChkColumn"];

            DataGridViewImageCell cell = dr.Cells[2] as DataGridViewImageCell;


            if (checkCell.Selected == true)
            {
                //need code to display the Image for this column here..
            }
            else
            {
                //need code to display the Image for this column here..
            }
        }
    }
4

0 回答 0