Implementing Name/Value Pair using DBGrid and DataView






2.33/5 (3 votes)
A utility for managing Name/Value pair data in a Web Form Applicateion
Introduction
- First of all the requirements for this project was partially taken from codeproject. So I took their requirement for a job they posted on their site and put 95% of the requirements into code. Name/Value pairs are to be entered into the upper DataGrid. This DataGrid is used for adding and filtering Name/Value pairs.
- When the ‘Add’ button is pressed the Name/Value pair in the textbox is validated, and then if it passes validation it is added to the DataGrid below. The Name/Value pair entry format is shown below:
- <name> = <value>
- Where <name> is the name portion of the pair, and <value> is the value portion of the pair. Only valid Name/Value pairs can be added. Names and Values can contain only alpha-numeric characters. The equal-sign is used to delimit the pair, spaces before and/or after the equal-sign may be entered as padding at the end-users discretion.
- When the ‘Sort by Name’ button is pressed the list will be sorted ascending by Name.
- When the ‘Sort by Value’ button is pressed the list will be sorted ascending by Value.
- When the ‘Delete’ button is pressed all selected items in the DataGrid will be deleted.
- When the ‘Filter’ button is pressed, only the
Name/Value pairs that match the filter criteria will be shown in the
DataGrid. The search criteria will be taken from the textbox.
Filters have the following format (and are similar to the Name/Value format):
<type> = <value>
Where <type> is either Name or Value, and <value> is a string used for matching against the given type.
Background
No Background Article
Using the code
Simply create virtual directory and compile source.
Points of Interest
The use of a Data Grid in place of a List Box, is more powerful than a simple list box. More features, more power
History
I will be posting updates to this article some next week.