Click here to Skip to main content
15,923,120 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to add a link in a gridview named update information(not update buttion which is buildin availble). where i have to write a code which event i have to invoke to write a code for update information).
pls share example code if any..
Posted

try this, for web applications..

ASP.NET
<asp:gridview id="GrdView" runat="server" xmlns:asp="#unknown">
    <columns>
         <itemtemplate>
               <asp:linkbutton id="lnkbtn" runat="server" text="Update" commandname="Update"></asp:linkbutton>
         </itemtemplate>
    </columns>
</asp:gridview>


On Row Update event

C#
Protected void GrdView_RowUpdating(Object sender,GridViewRowEventArgs e)
{
    // your code goes here..
}

hope it helps..
 
Share this answer
 
//in windows application
You cannot find "OnClick" event for cell inside DataGridView, as it does not exist.
You need to write your code on DataGridView1_CellClick event. check if clicked cell having linkbutton using column number.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900