Intersoft WebGrid Documentation
Walkthrough: Configuring automatic column sorting for a column using WebValueList
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to configure automatic column sorting for a column using WebValueList.

During this walkthrough, you will learn:

 Prerequisites

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

  • Visual Studio 2005 Application.

 Step-By-Step Instructions

To Configure Automatic Column Sorting for a Column using WebValueList

  1. Launch Visual Studio.NET 2005.
  2. Click on File menu, then select New and click Project.
  3. Select Visual C# Project in Project Types.
  4. Select ASP.NET Web Application in the Template box.
  5. Specify the Project's Location and click OK.
  6. Drag a WebGrid instance into WebForm.
  7. Drag an ISDataSource control into WebForm.
  8. Right click to the ISDatasource1 and select Configure Datasource. Choose ShemaType to DataSet and Schema Name to dsNorthWind_ReadOnly, then click Next.
  9. Add Categories, Products, and Suppliers tables. Click Finish.
  10. Open WebGrid.NET Designer - RootTable - Columns. Add ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, Discontinued columns.WGDEsigner
  11. In the SupplierID properties, set GroupInterval property to Text.
  12. Expand ValueList and set the following properties:

    Property Value
    DataMember Suppliers
    DataTextField CompanyName
    DataValueField SupplierID

  13. In the CategoryID properties, set GroupInterval property to Text.
  14. Expand ValueList and set the following properties:

    Property Value
    DataMember Categories
    DataTextField CategoryName
    DataValueField CategoryID

  15. Go to WebGrid LayoutSettings, set AllowGrouping to Yes and AllowFiltering to Yes.
  16. Go to RootTable, set UseValueListForSorting property to Yes.
  17. Compile and run the WebForm. The WebGrid will look like following.

  18. ColumnSortingWebValueList

 

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.