Duration: 16 minutes
Summary: When we are adding items to the inventory, it is obvious that the list will grow bigger and bigger. We need a way to easily search the list for items. We add a section to the main form to do just that. The user can select one or many of the item properties to search for (by color…). The grid will then refresh to show only the records that match the user’s criteria. We also add an option for the user to clear the search form and start over. In order to create the expression for filtering out the grid, we will use a StringBuilder that we append to as we see properties that the user wants to add. Once we are done with all the properties, we pass the expression to the filter and display the matching items.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: Windows Application and Visual Studio 2010
Keyword: Visual Studio 2010, StringBuilder, Append, Like, EventArgs, SelectedIndex, Filter, MessageBox, DateTime, Focus, BackColor, TryParse.