|
-
Apr 8th, 2011, 04:38 AM
#1
Thread Starter
New Member
How do i get checked values from textbox control in a gridview
Hello, am new to aspx.net and vb, but am developing an app that is to get values from textbox controls placed in a gridview control of an aspx page when the checkbox is checked, and those values i want to put them in another textbox, pls help.
-
Apr 8th, 2011, 09:02 AM
#2
Re: How do i get checked values from textbox control in a gridview
Hello,
Welcome to the forums!!
Are you wanting this to happen on the client side, i.e. using JavaScript/jQuery, or are you looking for this to happen on the server side by first doing a PostBack to the page?
Gary
-
Apr 8th, 2011, 09:20 AM
#3
Thread Starter
New Member
Re: How do i get checked values from textbox control in a gridview
thanks for your quick response gep13, i would like it to be at the server side
-
Apr 9th, 2011, 07:39 AM
#4
Re: How do i get checked values from textbox control in a gridview
Hello,
Without additional code, the checking of the CheckBox itself won't result in the RowCommand event of the GridView firing. But what you could do it add a Button to the Row of the GridView, then when that is pushed, inspect the current checked state of the CheckBox, and take appropriate action.
You can find details of the RowCommand here:
http://msdn.microsoft.com/en-us/libr...owcommand.aspx
Let me know if this doesn't make sense.
Gary
-
Apr 13th, 2011, 04:28 AM
#5
Thread Starter
New Member
Re: How do i get checked values from textbox control in a gridview
Yeah thanks alot, it does make sense a little, but not addressing the issue, i want to achieve something that looks like u adding recipient email addresses to a recipient email textfield extracted from a contact webpage from my project, where by the sender checks multiple checkboxes in the gridview to send the mail to. i dont know if u understand what am saying... please help.
-
Apr 19th, 2011, 01:37 AM
#6
Re: How do i get checked values from textbox control in a gridview
Hello there,
Yes, I am not sure that I follow what you are asking. From what you have described, I think that you can achieve it using the technique that I have pointed out, but perhaps not.
Can you please provide some additional information?
Gary
-
Apr 19th, 2011, 04:00 AM
#7
Re: How do i get checked values from textbox control in a gridview
Try something like this:
vb.net Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If ispostback Then Dim tbValues = From gvr In GridView1.Rows _ Select ctype(gvr.FindControl("TextBoxIDGoesHere"), TextBox).Text '' lets see what we have now For Each value In tbValues response.write(value) Next End If End Sub
(NB: this is freehand typed code, so might contain typos. But it should basically give you an idea how to go about it).
Last edited by Pradeep1210; Apr 19th, 2011 at 04:12 AM.
Reason: correction
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|