get row values from gridview when checkbox selected

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2009
Posts: 1
Reputation: chester.praiser is an unknown quantity at this point 
Solved Threads: 0
chester.praiser chester.praiser is offline Offline
Newbie Poster

get row values from gridview when checkbox selected

 
0
  #1
May 12th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 178
Reputation: Kusno is an unknown quantity at this point 
Solved Threads: 14
Kusno's Avatar
Kusno Kusno is offline Offline
Junior Poster

Re: get row values from gridview when checkbox selected

 
0
  #2
May 12th, 2009
Hi Chester,

try this :

  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
NEVER NEVER NEVER GIVE UP
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 37
Reputation: shefeekj has a little shameless behaviour in the past 
Solved Threads: 2
shefeekj shefeekj is offline Offline
Light Poster

Re: get row values from gridview when checkbox selected

 
0
  #3
May 15th, 2009
Yeah if u are using C#.net then you can check whether the checkbox is checked or not by the below line of code

  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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC