Intersoft WebGrid Documentation
Walkthrough: Using DropDownList in Filter Row
See Also Send comments on this topic.

Glossary Item Box

WebGrid.NET also supports filter column using DropDownList filter type.

During this walkthrough, you will learn how to do the following:

 Prerequisites

In order to complete this walkthrough, you will need the following:

  • Access to the Microsoft Access Northwind database
  • Visual Studio 2005 Application.

 Step-By-Step Instructions

To use DropDownList as filter type

  1. Launch Visual Studio.NET 2005.
  2. Click on File menu, then select New and click Web Site.
  3. Select ASP.NET Web Site in the Template box and set Location to HTTP.
  4. Named the Web Site and click OK.
  5. Right-click on Project's name and select Add New Item.
  6. Select Intersoft AppForm in the My Templates box and named it as Walkthrough.aspx.
  7. Drag WebGrid instance from ToolBar to WebForm.
  8. In the Solution Explorer, right-click on App_Data and select Add Existing Item.
  9. Browse and add NorthWind.mdb in C:\Program Files\Intersoft Solutions\Data (Default installation folder).
  10. Click the SmartTag on the upper right of the WebGrid.
  11. In ChooseDataSource field, choose <New data source...>.



  12. In DataSourceConfigurationWizard, choose ISDataSource and click next.



  13. Select the Schema Type that you want to use and click Next.



  14. Add 2 or more tables required and click Finish.



  15. Then, choose Retrieve Hierarchical Structure action in Connected to Data Source Control Wizard and click OK.



  16. Set the ValueList from column properties:

    Property Value
    DataSourceID ISDataSource1
    Data Member Categories
    Data Text Field CategoryName
    Data Value Field CategoryID

  17. Notice that CategoryID column content has been translated into CategoryName by utilizing WebValueList object of WebGrid. The most important thing is to configure the FilterEditType attribute of the CategoryID column into DropDownList.


  18. Do not forget to configure the AllowFilter attribute of the grid.
  19. Run the project.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.