void FilterByStaffirstName() { //create an instance clsStaffCollection Staff = new clsStaffCollection(); //Pass the text box value through the filter method Staff.FilterByStaffFirstName(txtMechanicStaffFilter.Text); lstMechanicRepairs.DataSource = Staff.StaffList; //Show the part required field in the list lstMechanicRepairs.DataValueField = "StaffID"; //Show the part required field in the list lstMechanicRepairs.DataTextField = "StaffFirstName"; //Bind the data to the list lstMechanicRepairs.DataBind(); }