Cant see TextBox1 in codeView [modified]
-
Hi all, I have the following gridview which has got a text box for any record entry of data on the grid. when i want to write some code for the TextBox, I cant see it on the code View.Is there any way i can access Textbox1 on the code associate it with the record on the grid. Thanks in advance for your help. -- Modified Sunday, February 21, 2010 2:16 PM
-
Hi all, I have the following gridview which has got a text box for any record entry of data on the grid. when i want to write some code for the TextBox, I cant see it on the code View.Is there any way i can access Textbox1 on the code associate it with the record on the grid. Thanks in advance for your help. -- Modified Sunday, February 21, 2010 2:16 PM
When you bind to multiple rows, what would you expect to see with a single ID for the textbox? You can't have multiple items called the same thing so you need to get at it some other way; and that way (unfortunately) is to use the Cells collection of the row you're interested in. This property provides you with indexer access to each cell, so you'll have to refer to something like Cells[0] to get the first textbox (bearing in mind you'll need to cast it to the appropriate type).
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.