Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Executing a Method when i click the template column

Reply
Thread Tools

Executing a Method when i click the template column

 
 
n.nsiva@gmail.com
Guest
Posts: n/a
 
      09-14-2006
Hai All

I have an problem and needs a solution, the problem is described
below..

I have place a datagrid with 3 bound columns and 1 template column
where on that template column i pace a link button web server control
on the item template. Now what i need is whenever i click that
particular linkbutton of a column i want to execute a simple method.

Hope all reply to me.
Sivakumar.N

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      09-16-2006
Hi,

wire a handler method to the LinkButton in the ItemTemplate

<asp:linkButton ID="..." OnClick="LinkButton_Click" />

It would make the event handler method same for all LinkButtons but you can
get the specific one by casting 'sender' argument to LinkButton. Another way
would be just applying CommandName attribute to it and handling ItemCommand
event (RowCommand in GridView)

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hai All
>
> I have an problem and needs a solution, the problem is described
> below..
>
> I have place a datagrid with 3 bound columns and 1 template column
> where on that template column i pace a link button web server control
> on the item template. Now what i need is whenever i click that
> particular linkbutton of a column i want to execute a simple method.
>
> Hope all reply to me.
> Sivakumar.N
>



 
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
click click click Andy Morrison Computer Support 7 12-20-2007 06:50 AM
setting Column width of Template Column in Datagrid.. Charleees ASP .Net 2 06-20-2006 12:52 PM
DataGrid loses view state if first column is a template column. Ken Varn ASP .Net 1 08-19-2005 02:54 PM
how to know if a datagrid column is a template column? Dexter ASP .Net 1 01-18-2005 01:45 PM
Bound Column or Template Column (w dAdapater?) in DataGrid Ravichandran Mahalingam ASP .Net Datagrid Control 0 01-09-2004 03:30 PM



Advertisments