During this walkthrough, you will learn how to do the following:
- Bind WebGrid using AccessDatasource.
- Setting a HtmlEditor in a grid column using WebGrid designer.
Prerequisites
In order to complete this walkthrough, you will need the following:
- Visual Studio 2005 Application.
Step-By-Step Instructions
To create new web application and specify HTMLEditor control in WebGrid
- Bind WebGrid to AccessDataSource.
- Please use Products table instead of Customers table.
- Right click on WebGrid and click on Retrieve Structure to retrieve all columns based on assigned DataSource.
- Go to the WebGrid designer.
- Set WebGrid's properties AllowEdit to true.
- In Advanced, click the Edit Control Type to HtmlEditor.
-
After that click the See all properties hyperlink and set Column Type to Custom.
-
You also need to set MaxHeight property to 20px. But if you want to set the cell to be multiline, then you need to set the MaxHeight property to -1px.
-
Run the project.
References
EditType Property
AllowEdit Property
CustomEditorName Property
Other Resources
Walkthrough Topics
How-to Topics