943,515 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 16385
  • ASP.NET RSS
May 12th, 2009
0

get row values from gridview when checkbox selected

Expand Post »
Hi all,

I'm new to asp .net. I would like to get the value from a GridView when a checkbox is checked. I'm creating an HR eAppraisal System.

Need to capture the Employee ID, the CompetencyID and the Evaluation Factor ID

I had a checkboxlist in a GridView. The Checkboxlist Values are fixed and varied from 0 to 5.

Help Please
Reputation Points: 10
Solved Threads: 0
Newbie Poster
chester.praiser is offline Offline
1 posts
since May 2009
May 12th, 2009
0

Re: get row values from gridview when checkbox selected

Hi Chester,

try this :

ASP.NET Syntax (Toggle Plain Text)
  1. Sub ActionSave()
  2. Dim Chk As New CheckBox
  3. Dim D As GridViewRow
  4. Dim EmployeeID As String = ""
  5.  
  6. For Each D In GVTD.Rows
  7. Chk = D.FindControl("ChkSelect")
  8. If Chk.Checked = True Then
  9. EmployeeID = D.Cell(1).Text.Trim()
  10. End If
  11. Next
  12. End Sub

Thank
Reputation Points: 11
Solved Threads: 17
Junior Poster
Kusno is offline Offline
191 posts
since Aug 2007
May 15th, 2009
0

Re: get row values from gridview when checkbox selected

Yeah if u are using C#.net then you can check whether the checkbox is checked or not by the below line of code

ASP.NET Syntax (Toggle Plain Text)
  1. CheckBoxList ch=New CheckBoxList()
  2. ch= ((DropDownList)(gdview.Rows[k].Cells[k].FindControl("Ch1")));
Last edited by peter_budo; May 15th, 2009 at 7:35 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 1
Solved Threads: 2
Light Poster
shefeekj is offline Offline
37 posts
since Apr 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: Grid View row cell becomes TextBox
Next Thread in ASP.NET Forum Timeline: How to make a SMS Gateway





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC