Right Click Event in Linkbutton

8 posts, 0 answers
  1. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 09 Jan 2009 Link to this post

    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
  2. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 10 Jan 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 12 Jan 2009 Link to this post

    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
  5. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 12 Jan 2009 Link to this post

    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.
  6. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 12 Jan 2009 Link to this post

    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
  7. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 16 Jan 2009 Link to this post

    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.
  8. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 17 Jan 2009 Link to this post

    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

  9. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 20 Jan 2009 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017