1
I added in my ListView
the checkbox
his pattern "Listview Checkboxes", when he is checked
I need to disable the same so that it can no longer be "check", I tried to make the checkbox
be as Enable false
, but I couldn’t access it, you’re trying to access the property ItemChecked
.
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
}
}
You could put the code of this Listview!?
– Maria
Thank you for answering, I put an example code that I created now, because I do not have the code in hand at the moment and an image of how it would be.
– Emerson Mendes