Intersoft WebGrid Documentation
Walkthrough: Configuring the WebValueList of a WebGridColumn to translate multiple values data
See Also Send comments on this topic.

Glossary Item Box

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

During this walkthrough, you will learn:

 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 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 two SqlDataSource controls into WebForm.
  8. Right click to the SqlDatasource1 and select Configure Datasource, then choose SqlSampleConnection.
  9. Select statement "SELECT * FROM [Employees]".

    SqlEmployees

  10. Right click to the SqlDatasource2 and select Configure Datasource, then choose SqlSampleConnection.
  11. Select statement "SELECT [RoleId], [RoleName] FROM [Roles]".

    SqlRoles

  12. Open WebGrid.NET Designer - RootTable - Columns. Add EmployeeID, FirstName, LastName, JoinDate, Roles columns.
  13. In LayoutSettings, set AllowEdit to Yes.
  14. In the Roles properties, expand ValueList and set the following properties:

    Property Value
    DataSourceID SqlDataSource2
    DataTextField RoleName
    DataValueField RoleId
    EnableMultipleValues True

  15. Compile and run the WebForm. The WebGrid will look like following.

  16. MultipleValueList

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.