Net-informations.com

Checkbox in ASP.NET GridView Control

The main advantages of the GridView control over other data-bound controls is its ability to automatically take advantage of data source capabilities. Also the GridView Control provides programmers ability to use any type of Web control in its columns using TemplateField.

Inserting a checkbox in gridview header template and check or uncheck all rows is a common requirement in most of the asp.net programs. In this lesson you will know how to use the CheckBox inside Gridivew control and how to select the multiple checkboxes and to get the selected CheckBoxes value will be displayed. Using this method you can Delete Multiple Rows In GridView In Asp.Net Using Checkbox.

Selecting multiple checkboxes inside a GridView control

checkbox in gridview

Database

In this article I have used Microsoft's Pubs database for sample data. You can download it free from the following link.

Download

Using Checkbox in ASP.NET GridView Control

You can insert a CheckBox control inside a GridView by using TemplateField.

checkbox select in gridview

How to fire an event in a checkbox inside a GridView

Here we placed a Button control for fire and event to retrieve the selected rows values from GridView to a Label on a Button Click event. From the following program you can learn how to fire an event and retrieve the selected values from GridView Control.

Default.aspx

C# Source Code

VB.Net Source Code







net-informations.com (C) 2019    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About