Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Gridview RowEditing event problem

Reply
Thread Tools

Gridview RowEditing event problem

 
 
=?Utf-8?B?V2lsbCBXaW5u?=
Guest
Posts: n/a
 
      04-25-2006
I have a gridview template field that I would like to get the value of during
the RowEditing event, but can't figure out how.
Here's an example of how I get the value of a cell for the row being edited:
Dim WasherNum As String = gvBrazeLoad.Rows(e.NewEditIndex).Cells(6).Text

It works if the Cell is databount, but it doesn't work for a template field.
How do I do it?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Y2xpY2tvbg==?=
Guest
Posts: n/a
 
      04-25-2006
TemplateFields contain controls that have value, they do not in themselves
have values, in the way that BoundFields do. You need to reference the
control. E.g. if the control was a textbox you could use the following in
C#:

TextBox MyTextBox =
(TextBox)gvBrazeLoad.Rows(e.NewEditIndex).Cells(6) .FindControl("TextBoxID");

MyTextBox.Text would then contain the value you want.

"Will Winn" wrote:

> I have a gridview template field that I would like to get the value of during
> the RowEditing event, but can't figure out how.
> Here's an example of how I get the value of a cell for the row being edited:
> Dim WasherNum As String = gvBrazeLoad.Rows(e.NewEditIndex).Cells(6).Text
>
> It works if the Cell is databount, but it doesn't work for a template field.
> How do I do it?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?V2lsbCBXaW5u?=
Guest
Posts: n/a
 
      04-25-2006
That did the trick.
Thanks

"clickon" wrote:

> TemplateFields contain controls that have value, they do not in themselves
> have values, in the way that BoundFields do. You need to reference the
> control. E.g. if the control was a textbox you could use the following in
> C#:
>
> TextBox MyTextBox =
> (TextBox)gvBrazeLoad.Rows(e.NewEditIndex).Cells(6) .FindControl("TextBoxID");
>
> MyTextBox.Text would then contain the value you want.
>
> "Will Winn" wrote:
>
> > I have a gridview template field that I would like to get the value of during
> > the RowEditing event, but can't figure out how.
> > Here's an example of how I get the value of a cell for the row being edited:
> > Dim WasherNum As String = gvBrazeLoad.Rows(e.NewEditIndex).Cells(6).Text
> >
> > It works if the Cell is databount, but it doesn't work for a template field.
> > How do I do it?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView RowEditing issue DavidC ASP .Net 0 03-31-2010 08:00 PM
The GridView 'GridView2' fired event RowEditing which wasn't handl egsdar ASP .Net 0 11-04-2008 04:51 PM
Unable to retrieve contents on RowEditing (to cancel editing) Radu ASP .Net 0 02-01-2008 04:59 PM
GridView RowEditing Requery question dev648237923 ASP .Net Datagrid Control 5 03-05-2007 07:35 AM
RowEditing event in GridView Shafia ASP .Net Building Controls 0 04-19-2005 12:29 PM



Advertisments