I have a Listview control "lstStudents" and i have added checkboxes inside the List viewControl.I need to add a Select All check box which results in checking all the checkboxes inside the ListView i use the following code but it doesn't work.
private void chkAll_CheckedChanged(object sender, EventArgs e)
{
foreach (Control cont in lstStudents.Controls)
{
if (cont.GetType() == typeof(CheckBox))
{
(cont as CheckBox).Checked = true;
}
}
}
I'm using c# windows Forms......