65.9K
CodeProject is changing. Read more.
Home

Implementing Name/Value Pair using DBGrid and DataView

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.33/5 (3 votes)

Mar 3, 2008

CPOL

2 min read

viewsIcon

21671

downloadIcon

148

A utility for managing Name/Value pair data in a Web Form Applicateion

Introduction

  1. 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.
  2. 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:
  3. <name> = <value>
  4. 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.
  5. When the ‘Sort by Name’ button is pressed the list will be sorted ascending by Name.
  6. When the ‘Sort by Value’ button is pressed the list will be sorted ascending by Value.
  7. When the ‘Delete’ button is pressed all selected items in the DataGrid will be deleted.
  8. 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.