I added in my ListView
the default% of it "ListView Checkboxes", when it is checkbox
I need to disable it so that it can no longer be "checked", I tried to make checked
checkbox
, but I could not access it, it is trying to access by the Enable false
property.
private void Form1_Load(object sender, EventArgs e)
{
ColumnHeader header = new ColumnHeader();
header.Text = "NOME";
header.Width = 415;
header.TextAlign = HorizontalAlignment.Center;
listView1.View = View.Details;
listView1.GridLines = true;
listView1.CheckBoxes = true;
listView1.Columns.Add(header);
for (int i = 0; i <= 10; i++ )
{
listView1.Items.Add(new ListViewItem(new string[] { "NOME_" + i }));
}
}
private void listView1_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (e.Item.Checked == true)
{
MessageBox.Show("CheckBox Checked");
//Aqui preciso desabilitar o CheckBox que foi Checked pra que não possa ser mais UnChecked
//ou desbilitar a row inteira
}
}