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

Right Click Event in Linkbutton

7 Answers 236 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rahul Khinvasara
Top achievements
Rank 1
Rahul Khinvasara asked on 09 Jan 2009, 01:57 PM
Hi,
I am using RadGrid,I have one of It's Column GridTemplateColumn under this column's Item Template,
 I have Linkbutton.What I am doing is on left click  of this link button I am opening one Rad window Popup.
But I want to implement new functionality that is in right click of that link button,(if I right click on any part of just about any software, I get a set of context-specific options as Cut Copy Paste etc) in same way I want that when I will do right Click on Link Button then in set of context-specific options I want one options "Delete that Row whose link button was clicked"  and When I will choose that option then that Row should be Delete.
 So I want how to check right click on Link Button Click and how to Add my Text in set of context-specific options,and How I'll perform Delete options on it.

 I'll be thankful If I'll get my Solutions.

Thanks

7 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Jan 2009, 04:29 PM
Hello Rahul,

I recommend you take a look at the following demo:
RadMenu integration

Let us know if you have more questions.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rahul Khinvasara
Top achievements
Rank 1
answered on 12 Jan 2009, 09:38 AM
Hi,
Great Thanks For reply...It went through that demo
Can we show Context Menu Options on right click of Linkbutton instead of rightclick on entire row of grid,
that Linkbutton is one of column in Radgrid.
 Please reply soon,If it is possible.

Thanks
0
Daniel
Telerik team
answered on 12 Jan 2009, 03:02 PM
Hello Rahul,

I suggest that you include a simple modification to achieve the desired functionality:

javascript
if (args.get_domEvent().target.id.indexOf("LinkButton1") > 0) 
    ... 

aspx
<telerik:GridTemplateColumn UniqueName="Template1" HeaderText="Template1"
    <ItemTemplate> 
        <asp:LinkButton ID="LinkButton1" runat="server" Text="Click" PostBackUrl="#" /> 
    </ItemTemplate> 
</telerik:GridTemplateColumn> 
 

Let me know if you need further assistance.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rahul Khinvasara
Top achievements
Rank 1
answered on 13 Jan 2009, 05:55 AM
Hi,Great Thanks for reply..

I tried that if condition in RowContextMenu Javascript function.From where that Context Menu option are displayed,
I applied this in starting..But still in right click of Linkbutton It is not displaying That Context Menu options ... (Now It is not displaying that Menu options  in row select and then right click,that is fine ) but what I'll do to display that context menu options in linkbutton's right click and plz tell me Where I'll put that condition to work it correct.
I hope I'll get my solution soon.

Thanks
0
Daniel
Telerik team
answered on 16 Jan 2009, 10:48 AM
Hello Rahul,

Please find my example attached to this ticket.

I hope this helps.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rahul Khinvasara
Top achievements
Rank 1
answered on 17 Jan 2009, 09:28 AM
Hello,I am very greatfull that u replied...

I tried that code which u sent me as attchment,But problem was that I have one column in RadGrid in which I have Taken Label
and Linkbutton simultaneously,But condition is that  one of them is displayed at one time,It's depends on datbase'return value  for  that column
      Either Linkbutton will Display or Label just.It's scenario like suppose in first row linkbutton is displayed but in Second row label is  displayed for that column.When I tried u'r sent code.then It display that Context Menu for every right cliick in that column.
 Please give me solution for displaying ContextMenu for only that Row which  displays link button and It should not work for label column.

Hope I'll get my solution soon...

Thanks

0
Daniel
Telerik team
answered on 20 Jan 2009, 02:46 PM
Hello Rahul,

If I understand your explanation clearly, the code I provided for you should be working as expected.
Otherwise it would be helpful if you modify it as in your scenario and send it back to me. Thus I will be able to assist you further.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Rahul Khinvasara
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Rahul Khinvasara
Top achievements
Rank 1
Share this question
or