C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




checkbox and Gridview


Posted Date: 11 Oct 2008      Total Responses: 2

Posted By: suresh       Member Level: Silver     Points: 1


Hi:
I have the following requirement

there is a AreaofInterest SQL Table that contains InterestId(PrimaryKey),AreaOfInterest fields.

1)i have some check boxes in gridview in which the Area of interests field Like
*Reading books,*Playeig cricket has been bounded

2)Now the user can select the Multiple check boxes and click the Insert botton.

3)once the insert button is clicked the corresponding InterestId for Areaofinterests which is choosen by user has to be inserted into the table.

Important condition is InterestId should should not be bounded with any controls on grid Meaning that we should not use Hidden fieldcontrol .

How to insert the correspoding Id in to table.Can any one send me code or suggestion to solve this issue.

Thnaks




Responses

Author: Vivek    11 Oct 2008Member Level: GoldRating:     Points: 4
Refer these

http://www.codeproject.com/KB/aspnet/dgcheckboxcolumn.aspx

http://www.dotnetspider.com/forum/151536-gridview-if-i-select-checkbox-selectall-all-records-should-be-inserted-into-database.aspx

http://www.dotnetspider.com/forum/162743-GridView-with-SelectAll-Checkbox.aspx

http://www.dotnetspider.com/forum/144589-how-use-checkbox-gridview-Using-ASP-net.aspx



Author: Athira Appukuttan    13 Oct 2008Member Level: DiamondRating:     Points: 4
Try like this..
Button_Click:

foreach(gridviewrow gvr in gridview1.rows)
{
checkbox chk=(checkbox)e.findcontrol("checkboxname");
if(chk!=null)
{
if(chk.Checked)
{
String RowIs=gridview1.datakeys[e.RowIndex].value.Tostring();
//Like this u can get selected rows details
}
}
}



Post Reply
You must Sign In to post a response.
Next : how to fill dropdownlist in this way .....
Previous : use substring function in javacript
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

masks masks masks

Contact Us    Privacy Policy    Terms Of Use