Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > using buttons in a gridview

Reply
Thread Tools

using buttons in a gridview

 
 
eagle
Guest
Posts: n/a
 
      07-09-2007
In the following article, it says to have a button ina gridview, you need
to capture the ItemCommand event. Well, there is no ItemCommand event in
the gridview. So I use the RowCommand. The Article says to use the
e.item.itemindex to determine the row that was selected, well the RowCommand
has no e.item.itemindex proeprty. So how am I supposed to put a button in a
gridview.

http://msdn2.microsoft.com/en-us/lib...3s(vs.80).aspx


 
Reply With Quote
 
 
 
 
martin marinov
Guest
Posts: n/a
 
      07-10-2007
Hello eagle,

> In the following article, it says to have a button ina gridview, you
> need to capture the ItemCommand event. Well, there is no ItemCommand
> event in the gridview. So I use the RowCommand. The Article says to
> use the e.item.itemindex to determine the row that was selected, well
> the RowCommand has no e.item.itemindex proeprty. So how am I supposed
> to put a button in a gridview.
>
> http://msdn2.microsoft.com/en-us/lib...3s(vs.80).aspx
>



Yes you are correct that in the GridViewCommandEventArgs class there is no
index of the row. Fo this purpose you can follow the sample of this article
that describes how you can handle the index of the row:
http://msdn2.microsoft.com/en-us/lib...owcommand.aspx

Regards
Marti


 
Reply With Quote
 
 
 
 
eagle
Guest
Posts: n/a
 
      07-12-2007
Thanks! That works!

"martin marinov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed). com...
> Hello eagle,
>
>> In the following article, it says to have a button ina gridview, you
>> need to capture the ItemCommand event. Well, there is no ItemCommand
>> event in the gridview. So I use the RowCommand. The Article says to
>> use the e.item.itemindex to determine the row that was selected, well
>> the RowCommand has no e.item.itemindex proeprty. So how am I supposed
>> to put a button in a gridview.
>>
>> http://msdn2.microsoft.com/en-us/lib...3s(vs.80).aspx
>>

>
>
> Yes you are correct that in the GridViewCommandEventArgs class there is no
> index of the row. Fo this purpose you can follow the sample of this
> article that describes how you can handle the index of the row:
> http://msdn2.microsoft.com/en-us/lib...owcommand.aspx
>
> Regards
> Martin
>
>



 
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
Created Radio Buttons displaying as if they were conventional buttons Dr. Leff Javascript 3 10-15-2007 09:47 PM
The Z axis and simple menu buttons/image buttons Jonathan N. Little HTML 3 04-02-2007 09:57 AM
Datagrid Nav buttons and numeric buttons Jeremy Jones ASP .Net 1 03-22-2007 08:00 AM
Image Buttons/Buttons not responding =?Utf-8?B?QmVu?= ASP .Net 1 07-06-2005 07:34 AM
2 buttons but want enter key in textbox to execute one buttons' click event? Roger ASP .Net 1 05-20-2005 09:47 PM



Advertisments