private void bindData(String searchString) { //load services if (this.serviceCodes == null) { TerminalService terminalService = new TerminalService(); this.serviceCodes = terminalService.getServices(); } List <ServiceViewModel> filteredList = new List <ServiceViewModel>(this.serviceCodes); //filter codes if (!String.IsNullOrWhiteSpace(searchString)) { filteredList = filteredList .Where(c => c.Code.StartsWith(searchString)) .ToList(); } gvServiceCodes.DataSource = filteredList; }