Microsoft Expression Web Gridview - Microsoft Expression Web

Why Gridview control is used?

The GridView control is used to show the values of a data source in a table. Each column represents a field, and each row represents a record. Let’s explain this in a step by step process.

Step 1 – Now create a new ASPX page in SQLDataSource project and call it gridview.aspx.

gridview

Step 2 – See the the ASP.NET Controls in tool box. Drag the GridView control and drop it over the form section.
asp_net_controls
You can find that the GridView context menu is open. Now select the <New data source…> from the Choose Data Source dropdown list. It will display the Data Source Configuration Wizard.
Step 3 – Let’s choose the data from SQL database and specify the data source ID. Click Ok.
datasource_id
Step 4 − Select the existing connection string as created in SQL DataSource chapter. It will be using the same database here also. Click Next.
existing_connection_string
Step 5 – To understand more ,let’s select the Student table and click the * checkbox which will retrieve all the columns from the student table. Click Next.
select_student_table
Step 6 − Test the query in the following wizard, so let’s click the Test Query button.
test_query_button
Upon clicking Next, it will display the following screen −
click_next
The Design View of gridview.aspx looks as follows −
gridview_aspx
Step 7 – Now preview the webpage in a browser. It will appear as follows −
appear
This is a simple table without any formatting.
Step 8 – Let’s format the GridView from the GridView Context menu.
gridview_context
Click the Auto Format… link. In the Auto Format dialog box, there are many predefined schemes. Select a scheme as per your requirement and click OK.
auto_format
Let’s preview the webpage in a browser again. It will look like the following screenshot.
screenshot

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Microsoft Expression Web Topics