PDA

View Full Version : edit arow in grid view by clicking on it


jayakpreddy
07-30-2008, 01:00 PM
Hi i am using a gridview,where i would like to edit a row by clicking on it
(just like our E mail inbox).Actually i wrote code in Rowcreated event for
selecting the row index. but i am not getting any idea how to map the the currently
selected row when clicked on it.

can any one help please

Regards

jaya

hedidit
07-31-2008, 11:35 PM
are you using boundfields or templatefields?

if boundfield, in the gridview declaration statement set AutoGenerateEditButton="true"

if you are using template fields,


<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="editActivity" runat="server" Text="Edit" CommandName="Edit"></asp:LinkButton>
<asp:LinkButton ID="deleteActivity" runat="server" Text="Delete" OnClientClick="return confirm('Delete Selected Row?');" CommandName="Delete"></asp:LinkButton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton ID="LinkButton2" runat="server" text="Update" CommandName="Update" CausesValidation ="true" ValidationGroup="editActivity" ></asp:LinkButton>
<asp:LinkButton ID="LinkButton3" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"></asp:LinkButton>
</EditItemTemplate>
<ItemStyle Width="15%" />
</asp:TemplateField>


does this answer your question?