We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,390 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to get textbox value in gridview

i have a gridview with a text box in it, i understand that i can use CommandArgument='<%# Eval("MyGridViewData")%>' to get the data in the gridview.. But i have no idea how to get the textbox value inside the gridview .. Can anyone help me? :(

3
Contributors
2
Replies
3 Days
Discussion Span
5 Months Ago
Last Updated
3
Views
mandyCheong
Newbie Poster
2 posts since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Hi

I dont know in which event you are trying to this? But if it is a grid related event you can use findControl or BindingContainer to retreive textbox Value

BhuvanRam
Light Poster
43 posts since Jul 2010
Reputation Points: 10
Solved Threads: 6
Skill Endorsements: 0

The row and cell index's are dependent on which row and cell you want to store the value:

This is for the first cell of the first row

dataGridView.Rows[0].cells[0].value = textBox1.Text;
ChrisHunter
Posting Pro
566 posts since Feb 2011
Reputation Points: 104
Solved Threads: 51
Skill Endorsements: 13

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0725 seconds using 2.7MB