Selecting multiple checkboxes inside a GridView control - From CodeProject.com
2006-05-09 10:39
639 查看
Selecting multiple checkboxes inside a GridView control
By azamsharpThis article describes how you can select checkboxes inside a GridView control.
http://www.codeproject.com/aspnet/SelChkboxesDataGridView.asp
Code snippet:
// StringBuilder object
StringBuilder str = new StringBuilder();
// Select the checkboxes from the GridView control
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox) row.FindControl("chkSelect")).Checked;
if (isChecked)
{
// Column 2 is the name column
str.Append(GridView1.Rows[i].Cells[2].Text);
}
}
// prints out the result
Response.Write(str.ToString());
By azamsharpThis article describes how you can select checkboxes inside a GridView control.
http://www.codeproject.com/aspnet/SelChkboxesDataGridView.asp
Code snippet:
// StringBuilder object
StringBuilder str = new StringBuilder();
// Select the checkboxes from the GridView control
for (int i = 0; i < GridView1.Rows.Count; i++)
{
GridViewRow row = GridView1.Rows[i];
bool isChecked = ((CheckBox) row.FindControl("chkSelect")).Checked;
if (isChecked)
{
// Column 2 is the name column
str.Append(GridView1.Rows[i].Cells[2].Text);
}
}
// prints out the result
Response.Write(str.ToString());
相关文章推荐
- Selecting multiple checkboxes inside a GridView control
- Selecting multiple checkboxes inside a GridView control
- Selecting multiple checkboxes inside a GridView control
- http://www.codeproject.com/KB/validation/MultipleDataAnnotations.aspx
- Get data by SAFEARRAY** from COM(VB Code) in My VC COM Project (Code Part)
- 利用webservice和.net技术上传和下载文件--Sending files in chunks with MTOM Web Services and .NET 2.0 from:http://www.codeproject.com/soap/MTO
- COM from code project
- Favorites from codeproject.com Nov,2006
- Inside Windows Handles[www.codeproject.com]
- 在Codeproject.com上post了我的第一篇文章:Custom ComboBox server control for ASP.NET
- 数组作为参数传给存储过程(from:http://www.codeproject.com/KB/database/SQLArrayParameterHandling.aspx)
- ListControl參考:http://www.codeproject.com/KB/list/SubItemSel.aspx
- [CodeProject每日一荐]实现Double Metaphone语音匹配算法[二]:Visual Basic的COM实现和关系数据库解决方案
- [CodeProject每日一荐]实现Double Metaphone语音匹配算法[三,四] VBScript调用COM;存储过程实现及高级话题
- http://www.codeproject.com/KB/database/Building_Dynamic_SQL.aspx?azid=2
- ASP.NET Internals: Request Architecture(http://www.codeproject.com/KB/aspnet/aspnetrequestarchitecture.aspx)
- .net 垃圾回收学习[http://www.codeproject.com/KB/dotnet/idisposable.aspx][翻译&&学习][2]
- datagird 多表头(转自www.codeproject.com)
- Could not find class 'org.achartengine.model.XYMultipleSeriesDataset', referenced from method com.ex
- codeproject.com被封了?