HighTechTalks DotNet Forums  

Retreiving a DataItem in the GridView's RowCommand

ASP.net Web Controls microsoft.public.dotnet.framework.aspnet.webcontrols


Discuss Retreiving a DataItem in the GridView's RowCommand in the ASP.net Web Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Nathan Sokalski
 
Posts: n/a

Default Retreiving a DataItem in the GridView's RowCommand - 12-14-2007 , 09:06 AM






I have a GridView with a ButtonField. In the RowCommand I need to use the
value of one of the fields used in that row. I am having trouble doing this,
so I would appreciate it if someone could help me here. Thanks.


Reply With Quote
  #2  
Old   
David Wier
 
Posts: n/a

Default Re: Retreiving a DataItem in the GridView's RowCommand - 12-14-2007 , 10:22 AM






What do you need to do with the value?

if it's a databound Gridview, you would use the onRowDatabound event.
Check out this sample:
http://www.aspnet101.com/aspnet101/a...onditionalDate

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup


"Nathan Sokalski" <njsokalski (AT) hotmail (DOT) com> wrote

Quote:
I have a GridView with a ButtonField. In the RowCommand I need to use the
value of one of the fields used in that row. I am having trouble doing
this, so I would appreciate it if someone could help me here. Thanks.



Reply With Quote
  #3  
Old   
Nathan Sokalski
 
Posts: n/a

Default Re: Retreiving a DataItem in the GridView's RowCommand - 12-14-2007 , 11:27 AM



This is a ButtonField, and the reason I need the value is so that I know
what SQL statement to execute on the database. The value is not being used
for display, it is being used for functionality. The RowDataBound event will
not help me here because I need to use the value in the RowCommand event, so
I need a way to access the data from the current row.

"David Wier" <dw (AT) dw (DOT) com> wrote

Quote:
What do you need to do with the value?

if it's a databound Gridview, you would use the onRowDatabound event.
Check out this sample:
http://www.aspnet101.com/aspnet101/a...onditionalDate

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with
no bloated markup


"Nathan Sokalski" <njsokalski (AT) hotmail (DOT) com> wrote in message
news:engljLmPIHA.6036 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
I have a GridView with a ButtonField. In the RowCommand I need to use the
value of one of the fields used in that row. I am having trouble doing
this, so I would appreciate it if someone could help me here. Thanks.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.