This is a migrated thread and some comments may be shown as answers.

Grid link to execute client click only

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 29 Jun 2012, 07:12 PM
Hello,

I have a RadGrid that have 3 command link buttons. the first 2 need to do post back to execute their function, and that is working ok.

However, the third link needs to execute only a javascript function on the client, without doing a post back. Currently, this is the way my link column looks

<telerik:GridTemplateColumn UniqueName="DDE1" ReadOnly="true" AllowFiltering="false" HeaderText="DateEntry1">
	<ItemTemplate>
		<asp:LinkButton ID="link3" runat="server" ToolTip='<%# Eval("NumberOfSeconds1")%>' Text='<%# Eval("NumberOfSeconds1")%>' OnClientClick='<%#Eval("infoPathEntry1", "redirectInfopath(\"{0}\")")%>' />						    
	</ItemTemplate>
	<ItemStyle Font-Size="Large" />
</telerik:GridTemplateColumn>            

The problem is that the onclientclick is executed, but then it does the server trip, refreshes the page and removes the jquery alert I generated.

Any ideas how can I achieve this?

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 30 Jun 2012, 06:54 AM
Hello,

<telerik:GridTemplateColumn>
    <ItemTemplate>
     <asp:LinkButton ID="link3" runat="server" ToolTip='<%# Eval("ID")%>'
         Text='<%# Eval("ID")%>' OnClientClick='<%#Eval("ID", "redirectInfopath(\"{0}\"); return false;")%>' />
   </ItemTemplate>
</telerik:GridTemplateColumn>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or