.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

checkbox in grideview

Posted By: Raj     Posted Date: January 01, 2009    Points:2   Category :C#
I want to display the selected item in gridview on another page using gridview..
plz help me...

Responses
Author: Rahul             
Posted Date: January 01, 2009     Points: 5   

Hi,
Please refer this link to add checkbox inside gridview.


http://www.dotnetspark.com/Forum/135-checkbox-inside-gridview-asp-net.aspx

Author: Kumar             
Posted Date: January 21, 2009     Points: 5   

Hi,

Please loop through gridview and get all the checkbox item and store the values and take that values and post it to another page

Thanks and regards,
Kumar

Author: Athira Sreejith             
Posted Date: February 02, 2009     Points: 5   

Hi..

Put one checkboc inside the gridview and outside one bustton like

<itemtemplate>
<asp:CheckBox ID="chkDelete" AutoPostBack="true" runat="server"
ToolTip="Delete" />
</itemtemplate>


<asp:Button ID="btnGet" runat="server" Text="Delete Information" OnClick="btnGet_Click"
CausesValidation="false" />

protected void btnGet_Click(object sender, EventArgs e)
{

foreach(gridview gvr in gridview1.rows)
{
checkbox chk=(checkbox)gvr.findcontrol("checkboxname");
if(chk.checked)
{
InfoId=gvr.datakeys[e.RowIndex].value.tostring();
InfoId += "'" + InfoId + "',";

if ((InfoId != "") || (InfoId != null))
{
InfoId = InfoId.Substring(0, InfoId.Length - 1);
}
}

}
}



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend