PC Review


Reply
Thread Tools Rate Thread

Edit & Copy buttons in gridview

 
 
tester
Guest
Posts: n/a
 
      17th Feb 2009
I have two command buttons in my gridview, both the same because I want to
launch the rowedit command. But one is a Copy function that will launch the
edit command but when the user hits update will grab the flag and insert a
new record instead of update the selected one. In the row command event,
all properties seem to have the same value, the commandname for both buttons
are "Edit", and there's no way in the command button itself to set the
CommandName, how do I distinguish between the two buttons. One says copy
and one says edit but there doesn't seem to be a way to grab that
information.

<asp:CommandField ShowEditButton="True" >
<HeaderStyle BorderColor="White" BorderStyle="None"
Font-Underline="False" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
</asp:CommandField>
<asp:CommandField ShowEditButton="True" EditText="Copy">
<HeaderStyle BorderColor="White" BorderStyle="None"
Font-Underline="False" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
</asp:CommandField>

Protected Sub Gridview_RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs)
If e.CommandName = "Copy" Then
'set a flag here for copy mode End If

End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
If I have a gridview with edit buttons, how do I show dropdowns inedit mode? COHENMARVIN@lycos.com Microsoft ADO .NET 0 30th Apr 2008 02:27 PM
Hide Edit or Delete Buttons per Row in a GridView Kevin Frey Microsoft ASP .NET 3 27th Nov 2006 10:05 PM
GridView edit validation, edit dropdown list, delete popup confirm =?Utf-8?B?a2Vu?= Microsoft ASP .NET 1 23rd Jan 2006 12:51 PM
Why can't I edit my excel document? Edit buttons shaded. =?Utf-8?B?QXJsIEAgQ0JD?= Microsoft Excel New Users 3 7th Sep 2005 01:18 AM
Explorer "Edit File Type" dialog Edit/Remove buttons grayed out =?Utf-8?B?QmlsbCBNb2xvbnk=?= Windows XP General 11 28th Feb 2005 12:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 PM.