public void Initialize(List<X> x1) { chkList.DataSource = x1; chkList.DisplayMember = "MeterName"; // MeterName is a property in Class X chkList.ValueMember = "PortNum"; // PortNum is a property in Class X } private void Click_Event(object sender, EventArgs e) { List<X> x2 = new List<X>(); // Here I want to get the checkedListBox selected items in x2; // How to get it...??? }
private void Click_Event(object sender, EventArgs e) { var x2 = new List<X>(); foreach (X item in chkList.CheckedItems) { x2.Add(item); } }
List<x> x2 = new List<x>(); foreach (ListItem Ck in chkbl.Items) { if (Ck.Selected == true) { x2.add(Ck.Text.ToString().Trim()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)