good to know. thanks.
Dwayne
----- Original Message ----
From: Dean Fiala <dfiala gmail.com>
To: AspNetAnyQuestionIsOk@yahoogroups.com
Sent: Monday, January 29, 2007 6:12:07 PM
Subject: Re: [AspNetAnyQuestionIsOk] Gridview Edit / Update
problem
OK,
This is a side-effect of M$'s declarative programming binge.
The
e.NewValues, e.OldValues only get populated when you are
using a datasource
control to bind to the GridView. Doesn't seem to be well
documented.
So, to get the value if you are not doing this, you need
just a little
something to get a reference to the GridViewRow control and
then go about
your business the old way.
Dim Row As GridViewRow = GridView1.Rows( e.RowIndex)
Dim Text As TextBox = Row.FindControl( "name")
On 1/29/07, dwayne dhope. net <dwayne dhope.
net> wrote:
>
> I haven't tried this, but I believe you can use
e.NewValues[ "name" or
> index] to retrieve the value and then cast it into the
correct data type.
>
> Dwayne
>
> ----- Original Message ----
> From: "rherrmann05 comcast.net
<rherrmann05% 40comcast. net>" <
> rherrmann05 comcast.net <rherrmann05% 40comcast.
net>>
> To: AspNetAnyQuestionIs Ok yahoogroups.
com<AspNetAnyQuestionI sOk%40yahoogroup s.com>
> Sent: Monday, January 29, 2007 1:59:44 PM
> Subject: Re: [AspNetAnyQuestionI sOk] Gridview Edit /
Update problem
>
> Hey Dean. Thanks for the reply. Actually I tried that
before I posted
> here. I get this error when I try this:
>
> Item is not a member of System.Web.Iu. Webcontrols.
GridviewUpdateEv
> entArgs.
>
> Thanks,
> Bob
>
> ------------ -- Original message ------------ --
> From: "Dean Fiala" <dfiala gmail.
com>
> Dim tCaseVolume As TextBox = CType(e.Item. FindControl(
"YourTextBoxName
> Here",
> TextBox)
>
> On 1/29/07, rherrmann05 comcast.net
<rherrmann05 comcast.net> wrote:
> >
> > Hi all,
> >
> > I have a gridview on a web page and now want to
make a few columns
> > editable. I used to do this with a datagrid and
never had a problem. But
> I
> > am struggling with the gridview syntax. Presently,
I can click the Edit
> > button on a row in my grid and the editable column
becomes a textbox.
> The
> > Updat and Cancel buttons are now displayed. The
Cancel button works
> fine.
> > But I do not know how to extract the value of the
textbox so that i can
> save
> > it. I am very close. Maybe someone can help me.
Here is my code: The
> line
> > where I Dim tCaseVolume is where I am having
problems getting my value.
> >
> > Sub UpdateRow(ByVal sender As Object, ByVal e As
> > System.Web.UI. WebControls. GridViewUpdateEv
entArgs) Handles
> > gvCategories. RowUpdating
> > Dim tCaseVolume As TextBox = CType(e.NewValues(
).Item(0) , TextBox)
> > Dim objPerformanceMinim ums As New
> > PerformanceMinimums (Session(
"ConnectionStrin g"))
> > objPerformanceMinim ums.Save( 0, CInt(Session(
"ProjectID" )),
> > tCaseVolume. Text)
> > gvCategories. EditIndex = -1
> > BindGrid()
> > End Sub
> >
> > Thanks!
> > Bob
> >
> > [Non-text portions of this message have been
removed]
> >
> >
> >
>
> --
> Dean Fiala
> Very Practical Software, Inc
> Now with Blogging...
> http://www.vpsw.
com/blogbaby
> Microsoft MVP
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>
>
--
Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.
com/blogbaby
Microsoft MVP
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:AspNetAnyQuestionIsOk-digest@yahoogroups.com
mailto:AspNetAnyQuestionIsOk-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|