WebGrid now includes a new ButtonImage column type. Therefore, you can simply display a button with image.
In this topic, you will learn how to display button image in WebGrid.
To use ButtonImage column type
- Bind WebGrid to AccessDataSource (Using Customers table from NorthWind data source).
- Open WebGrid.NET Designer >> Advanced.
- Go to RootTable >> Columns. Add a new column and named it as btnImage.
- Set Column Type to Button Image, ButtonAutoPostBack to True and ButtonImage to the location of the image's directory.
- Click OK to apply the settings.
- Save and run the project. The ButtonImage column type will look like following:
Tasks
Walkthrough: Utilizing various ColumnTypes
Other Resources
Walkthrough Topics
How-to Topics