Intersoft Support Center

Display Multiple Values in WebValueList

This walkthrough shows you how to configure the WebValueList of a WebGridColumn to translate multiple values data.

During this walkthrough, you will learn:

  • Use SqlDatasource to bind the grid.
  • Use WebValueList.
  • To translate multiple values data using improved WebValueList feature.

 Prerequisites

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

  • Visual Studio 2005/2008/2010 Application.

 Step-By-Step Instructions

To configure the WebValueList of a WebGridColumn to translate multiple values data 

  1. Launch Visual Studio.NET 2008.
  2. Click on File menu, then select New and click Web Site.
  3. Select ASP.NET Web Site in Template Box and set Location to HTTP.
  4. Named the Web Site and click OK.
  5. Drag a WebGrid instance into WebForm.
  6. Drag two SqlDataSource controls into WebForm.
  7. Right click to the SqlDatasource1 and select Configure Datasource, then choose SqlSampleConnection.
  8. Choose Employees from the dropdownlist table and check all (*) columns.
    SqlEmployees

  9. Right click to the SqlDatasource2 and select Configure Datasource, then choose SqlSampleConnection.
  10. Choose Roles from the dropdownlist table and check RoleId and RoleName columns.
    SqlRoles

  11. Open WebGrid's SmartTag. In Choose Data Source field, select SqlDataSource1 from the dropdownlist.
  12. Select Retrieve Structure and click OK afterwards.
  13. Open WebGrid Designer - RootTable - Columns. Add EmployeeID, FirstName, LastName, JoinDate, Roles columns.
  14. In LayoutSettings, set AllowEdit to Yes.
  15. In the Roles properties, expand ValueList and set the following properties:

    Property Value
    DataSourceID SqlDataSource2
    DataTextField RoleName
    DataValueField RoleId
    EnableMultipleValues True

  16. Compile and run the WebForm. The WebGrid will look like following. MultipleValueList
Previous Next