Multiple Listbox filters with select all at Linq

I have 2 listbox like below. I want to filter the list from the listbox parameters, forexample segment A and All Status. What should I write into the ALL value in the Listbox? <select class="form-select form-select-solid" name="Segment"> <option value="???">All</option> <option value="A">Segment A</option> <option value="B">Segment B</option> <option value="C">Segment C</option> </select> <select class="form-select form-select-solid" name="Status" > <option… Read More Multiple Listbox filters with select all at Linq

Invalid cast error occurs in calculating elements in the listbox

I am trying to calculate the median value from Listbox data in C#. However, occurs invalid cast exception occurs in foreach statement as below (in bold) : foreach (string item in ListBox1.Items) can anyone help me how to fix this error? will be highly appreciated. Thank you. System.InvalidCastException: Unable to cast object of type ‘System.Int32’… Read More Invalid cast error occurs in calculating elements in the listbox