Displaying the results in a DataGrid
After creating a DataSet to hold the search results (see Searching with only one search parameter (ASP.NET) or Searching with multiple search parameters (ASP.NET)), you can use a DataGrid to display the information on the page.
To display the search results in a DataGrid:
- On the search page, place the insertion point where you want the DataGrid to appear.
- In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select DataGrid.
The DataGrid dialog box appears.
- In the ID text box, enter a name for the DataGrid such as dgLocation.
- In the DataSet pop-up menu, select the DataSet you defined to hold the search results.
- Complete the rest of the dialog box as desired.
For more information, click the Help button on the dialog box.
Heres an example of a DataGrid dialog box that will create a DataGrid with three columns and ten rows, and links to previous and next pages of results.
The DataGrid will appear the first time the search page loads even if the user hasnt conducted a search yet. You can hide the DataGrid when the page loads the first time. See Hiding the DataGrid the first time the page loads.