WEBSWAPP Silverlight ASP.NET 3.5 ASP.NET 2.0 ASP.NET 1.0
Cascading Lists
ITemplate
DDL in GridView
G/V MultiSelect
Nested GridViews
RegExp
DataGrid Reorder
Events fire twice
Hyperlink Field
TextBox
UpdateParameters
MultiView
TreeView
C#-GridView VB-FormView

How to select several rows on a GridView?

In this sample I used a TemplateField with an ItemTemplate containing a CheckBox server control to build the first column of the GridView. You can select a row by clicking anywhere on the row or by checking the checkbox.

I have also added to the web page a JavaScript using the RegisterClientScriptBlock method to prompt you for confirmation before proceeding with the delete.

Company NameCityCountry
Alfreds FutterkisteBerlinGermany
Ana Trujillo Emparedados y heladosMéxico D.F.Mexico
Antonio Moreno TaqueríaMéxico D.F.Mexico
Around the HornLondonUK
Berglunds snabbköpLuleåSweden
Blauer See DelikatessenMannheimGermany
Blondesddsl père et filsStrasbourgFrance
Bólido Comidas preparadasMadridSpain
Bon app'MarseilleFrance
Bottom-Dollar MarketsTsawassenCanada
12345678910
Viewing page 0 of 10Reset

Source code:

C#-GridView source code clsOrder.cs clsProduct.cs clsProdListItem.cs