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

[Solved] How to disable an Image Button on a radgrid?

1 Answer 285 Views
Grid
This is a migrated thread and some comments may be shown as answers.
GarryP
Top achievements
Rank 1
GarryP asked on 10 Aug 2009, 08:48 AM
Hi,

I added an image button into a radgrid but i dont want it to do anything therefore I would like to find out if we can disable the click. I want users to see the image not click it.

Thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Aug 2009, 09:16 AM
Hi Garry,

I guess you have placed ImageButton in GridTemplateColumn and want to prevent the OnClick server event of ImageButton. If so, you could add OnClientClick event to return false which will prevent the postback, as shown below.

ASPX:
 
<telerik:GridTemplateColumn> 
<ItemTemplate> 
    <asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="return false;" ImageUrl="~/Images/Image1.gif" /> 
</ItemTemplate> 
</telerik:GridTemplateColumn> 

-Shinu.
Tags
Grid
Asked by
GarryP
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or