Click here to Skip to main content
15,905,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Please copy paste the following code in C# html and run. Then only you will get the full design. My question is i want to take the cell[0] value and itemtemplate textbox value and checkbox status from this gridview at runtime and i need to store it in the database? How can i to do this? Last 10 days i struck on this.

<

Contract NoBP NameQ3/14-15Q4/14-15Q1/15-16Q2/15-16Q3/15-16Approve
TargetsAchievementsTargetsAchievementsTargetsAchievementsTargetsAchievementsTargets
PCPCAudit ScorePCPCAudit ScorePCPCAudit ScorePCPCAudit ScorePCPremiunm NBAIORCM RemarksRemarks
2002130Infotech Computers & Communications4048100402078.540118040670000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl05$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl05$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_0" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_0" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl05$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl05$CheckBox1\',\'\')', 0)">
2004030The White House Infotech1601639017018077.515015188.515081010000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl06$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl06$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_1" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_1" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl06$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl06$CheckBox1\',\'\')', 0)">
20070514Photomax Industries         253004000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl07$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl07$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_2" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_2" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl07$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl07$CheckBox1\',\'\')', 0)">
20080584Sunrise Electro Solutions40640404157.5404187.540707210000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl08$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl08$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_3" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_3" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl08$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl08$CheckBox1\',\'\')', 0)">
20090329B Tech Solutions401482.5404072.54013604038874000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl09$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl09$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_4" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_4" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl09$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl09$CheckBox1\',\'\')', 0)">
20091429Hardware Zone40134040825403504000000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl10$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl10$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_5" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_5" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl10$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl10$CheckBox1\',\'\')', 0)">
20100279Computer Empire         6063946000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl11$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl11$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_6" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_6" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl11$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl11$CheckBox1\',\'\')', 0)">
20130451Fore Techniques6087102.57010111070901109095101.57500  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl12$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl12$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_7" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_7" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl12$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl12$CheckBox1\',\'\')', 0)">
20130536Andaaz Communication25025265250254035035472.535035290.535000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl13$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl13$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_8" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_8" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl13$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl13$CheckBox1\',\'\')', 0)">
20130554Chawla Infotech4058540414140604041384000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl14$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl14$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_9" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_9" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl14$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl14$CheckBox1\',\'\')', 0)">
20130583Achates Systems404576404148.5404170404090.54500  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl15$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl15$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_10" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_10" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl15$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl15$CheckBox1\',\'\')', 0)">
20140060Enaar 9 Services401445404165404273.54041734500  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl16$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl16$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_11" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_11" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl16$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl16$CheckBox1\',\'\')', 0)">
20140171Tarsem Computer & Services406980404950505260404155000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl17$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl17$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_12" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_12" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl17$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl17$CheckBox1\',\'\')', 0)">
20140199JT Infotech Pvt ltd5041 50030407257.560080.56000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl18$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl18$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_13" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_13" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl18$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl18$CheckBox1\',\'\')', 0)">
20150136Computer Plaza         606089.56000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl19$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl19$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_14" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_14" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl19$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl19$CheckBox1\',\'\')', 0)">
20150169Famous Computer         4041634000  <textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl20$txtLITEApprovalRemarks" rows="2" cols="20" onchange="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl20$txtLITEApprovalRemarks\',\'\')', 0)" id="ContentPlaceHolder1_GridViewForLite_txtLITEApprovalRemarks_15" onkeyup="LITEApproveRemarks(this)"></textarea>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_15" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl20$CheckBox1" onclick="LITEApproveCheckbox(this);setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$GridViewForLite$ctl20$CheckBox1\',\'\')', 0)">

>
Posted
Comments
Anisuzzaman Sumon 9-Dec-15 4:55am    
Where is your code?
Member 10556393 9-Dec-15 5:08am    
<asp:GridView ID="GridViewForLite" runat="server" OnRowDataBound="GridViewForLite_RowDataBound" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4">
<columns>
<asp:BoundField DataField="Contract No" HeaderText="Contract No">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField DataField="BP Name" HeaderText="BP Name">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Targets" DataField="PC">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField DataField="APC" HeaderText="Achievements">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Achievements" DataField="Audit Score">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Targets" DataField="PC1">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField DataField="APC1" HeaderText="Achievements">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Achievements" DataField="Audit Score1">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Targets" DataField="PC2">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField DataField="APC2" HeaderText="Achievements">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Achievements" DataField="Audit Score2">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Targets" DataField="PC3">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField DataField="APC3" HeaderText="Achievements">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField HeaderText="Achievements" DataField="Audit Score3">
<HeaderStyle Wrap="False" />
<itemstyle wrap="False">

<asp:BoundField DataField="PC4" HeaderText="Targets" />
Member 10556393 9-Dec-15 5:13am    
This is the gridview coding for runtime,

<table cellspacing="0" cellpadding="4" rules="all" id="ContentPlaceHolder1_GridViewForLite" style="background-color:White;border-color:#CC9966;border-width:1px;border-style:None;border-collapse:collapse;">
<tbody><tr style="color:#FFFFCC;background-color:#990000;font-weight:bold;">
<td align="center" rowspan="3">Contract No</td><td align="center" rowspan="3">BP Name</td><td align="center" colspan="3">Q3/14-15</td><td align="center" colspan="3">Q4/14-15</td><td align="center" colspan="3">Q1/15-16</td><td align="center" colspan="3">Q2/15-16</td><td align="center" colspan="5">Q3/15-16</td><td align="center" rowspan="3">Approve</td>
</tr><tr style="color:#FFFFCC;background-color:#990000;font-weight:bold;">
<td align="center" colspan="1">Targets</td><td align="center" colspan="2">Achievements</td><td align="center" colspan="1">Targets</td><td align="center" colspan="2">Achievements</td><td align="center" colspan="1">Targets</td><td align="center" colspan="2">Achievements</td><td align="center" colspan="1">Targets</td><td align="center" colspan="2">Achievements</td><td align="center" colspan="5">Targets</td>
</tr><tr style="color:#FFFFCC;background-color:#990000;font-weight:bold;">
<td align="center" colspan="1">PC</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">Audit Score</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">Audit Score</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">Audit Score</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">Audit Score</td><td align="center" colspan="1">PC</td><td align="center" colspan="1">Premiunm NB</td><td align="center" colspan="1">AIO</td><td align="center" colspan="1">RCM Remarks</td><td align="center" colspan="1">Remarks</td>
</tr><tr style="color:#FFFFCC;background-color:#990000;font-weight:bold;">

</tr><tr style="color:#330099;background-color:White;">
<td style="white-space:nowrap;">2002130</td><td style="white-space:nowrap;">Infotech Computers & Communications</td><td style="white-space:nowrap;">40</td><td style="white-space:nowrap;">48</td><td style="white-space:nowrap;">100</td><td style="white-space:nowrap;">40</td><td style="white-space:nowrap;">20</td><td style="white-space:nowrap;">78.5</td><td style="white-space:nowrap;">40</td><td style="white-space:nowrap;">11</td><td style="white-space:nowrap;">80</td><td style="white-space:nowrap;">40</td><td style="white-space:nowrap;">6</td><td style="white-space:nowrap;">70</td><td>0</td><td>0</td><td>0</td><td> </td><td>
<textarea name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl05$txtLITEApprovalRemarks" rows="2" cols="20" ></textarea>
</td><td>
<input id="ContentPlaceHolder1_GridViewForLite_CheckBox1_0" type="checkbox" name="ctl00$ContentPlaceHolder1$GridViewForLite$ctl05$CheckBox1" >
</td>
</tr><tr style="color:#330099;background-color:White;">
<td style="white-space:nowrap;">2004030</td><td style="white-space:nowrap;">The White House Infotech</td><td style="white-space:nowrap;">160</td><td style="white-space:nowrap;">163</td><td style="white-space:nowrap;">90</td><td style="white-space:nowrap;">170</td><td style="white-space:nowrap;">180</td><td style="white-space:nowrap;">77.5</td><td style="white-s
Anisuzzaman Sumon 9-Dec-15 5:19am    
please elaborate your question by specifying your need.
Member 10556393 9-Dec-15 5:24am    
I need to store the values which is inside itemtemplate textbox and checkbox value to database based on contract no. I am not able to take values. Because the first three rows are header and it is disigned at runtime. So it will not take the values.

1 solution

Try Like this .This may help you.

In ASPX:
<<pre lang="ASP.NET">%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplicationGridview._Default" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1><%: Title %>.</h1>
<h2>Modify this template to jump-start your ASP.NET application.</h2>
</hgroup>
<p>
To learn more about ASP.NET, visit <a href="http://asp.net" title="ASP.NET Website">http://asp.net</a>.
The page features <mark>videos, tutorials, and samples</mark> to help you get the most from ASP.NET.
If you have any questions about ASP.NET visit
<a href="http://forums.asp.net/18.aspx" title="ASP.NET Forum">our forums</a>.
</p>
</div>
</section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<asp:GridView ID="gdv" AutoGenerateColumns="false" runat="server" OnRowCommand="gdv_RowCommand">
<Columns>
<asp:BoundField HeaderText="ID" DataField="Id" />

<asp:TemplateField>
<ItemTemplate>
<asp:TextBox ID="txtToDo" runat="server" Text='<%# Eval("ToDo")%>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="IsDone" runat="server" Checked='<%# Eval("IsDone")%>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>

</asp:GridView>


<asp:Button ID="btnShow" Text="Show" runat="server" OnClick="btnShow_Click"
/>

<asp:Label ID="lblSelected" runat="server"></asp:Label>

</asp:Content>


In code behind(C#)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplicationGridview
{
public partial class _Default : Page
{
EF_TestDBEntities db = new EF_TestDBEntities();
protected void Page_Load(object sender, EventArgs e)
{
List<todos> lstToDos = new List<todos>();
lstToDos = db.ToDos.ToList();

gdv.DataSource = lstToDos;
gdv.DataBind();
}

protected void gdv_RowCommand(object sender, GridViewCommandEventArgs e)
{

}

protected void btnShow_Click(object sender, EventArgs e)
{
string selectedID = "";
foreach (GridViewRow row in gdv.Rows)
{

CheckBox chk = (CheckBox)row.FindControl("IsDone"); //this way you can also get the value of a textbox in the row
TextBox txtToDo = (TextBox)row.FindControl("txtToDo");

if (chk.Checked)
{
selectedID += "id="+row.Cells[0].Text + ",ToDo="+txtToDo.Text;

}
}

lblSelected.Text = selectedID;
}
}
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900