[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Obtaining Text from GridView Text Box in edit mode from RowUpdating event.

Posted on 2006-11-28
6
Medium Priority
?
411 Views
Last Modified: 2008-02-01
I am trying to obtain Text from GridView Text Box in edit mode from RowUpdating event. I tried to use a posted solution:

CType(e.Row.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).Text

I get the following error...
Error      3      'Row' is not a member of 'System.Web.UI.WebControls.GridViewUpdateEventArgs'.

The example posted used "ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs" and somehow resolved this.... I am using .NET 2.0

Also, I am doing this from a constructed data set and not directly to a database!

Thanks!
0
Comment
Question by:pauljcaron
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 9

Assisted Solution

by:kraffay
kraffay earned 300 total points
ID: 18032300
Can you try this:

Ctype(yourGridName.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).Text

0
 

Author Comment

by:pauljcaron
ID: 18032585
I tried the suggested line which resulted in a cast exception. I changed TextBox to Label and retrieved the original value. Not sure where to go from here since the TextBox is in the display.
0
 
LVL 9

Assisted Solution

by:kraffay
kraffay earned 300 total points
ID: 18032634
You may have to play around with the indexes of the cells and controls to get a handle to the textbox.  Usually the Gridviw puts a label, a text, and another label in each cell.
0
 
LVL 5

Assisted Solution

by:hfpon
hfpon earned 60 total points
ID: 18033555
Perhaps you want to tell us the problem you are facing, not focus on the solution you think that will work.....
We may be able to help you further then....

Can you post your code and what you want to do with it?
0
 
LVL 9

Accepted Solution

by:
bele04 earned 1140 total points
ID: 18034597
Why don't you try using the FindControl() method and see if your textbox is there:

TextBox tb = CType(yourGridName.Rows(e.RowIndex).FindControl("<id_of_your_textBox>"), TextBox)

if(tb != null)
{
    //Textbox is found.
    //Do processing stuff here.
}
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question