Ajax-enabled RadMenu as context menu in RadGrid with out using the GridEditCommandColumn

Thread is closed for posting
2 posts, 0 answers
  1. 60022062-EC04-47D6-A2C0-70EC396BC885
    60022062-EC04-47D6-A2C0-70EC396BC885 avatar
    4 posts
    Member since:
    Oct 2006

    Posted 23 Aug 2007 Link to this post

    Requirements

    RadControls version

    RadGrid 4.6.0
    RadMenu 4.3.0
    RadAjax 1.7.0

    .NET version

    2.0

    Visual Studio version

    2005

    programming language

    VB.NET

    browser support

    all browsers supported by RadControls


    HOW-TO
    Use an Ajax-enabled RadMenu as context menu in RadGrid with out using the GridEditCommandColumn

    DESCRIPTION
    This code library extends the approach demonstrated in the Ajax-enabled RadMenu as context menu in RadGrid knowledge base article using only the RadMenu for the Add / Edit, Save / Cancel functionality.
     
    In numerous cases you may want to display a context menu when right-clicking an arbitrary row in RadGrid. Through a command from that context menu you may want to change the state for the grid row (for example edit/delete/add/save/cancel). Furthermore, you may prefer the operation with asynchronous request instead of postback.

    SOLUTION 
    Basically what we do is:
    • First, we need to display the RadMenu in the to-be-inserted row, we can do that adding an Attribute to the insert row in the PreRender event of the RadGrid.
    • Second we consume the client event OnRowContextMenu and based on the index and the ItemType property of the RadGridTableRow object we show or hide the RadMenuItems (when the index is -1 we are talking about a insert row)
    • Finally, inside the handler (the ItemClick event handler of RadMenu) perform the corresponding task chosen by the user to modify the item state
  2. C7498A83-7E2E-418C-8791-93EF573A7569
    C7498A83-7E2E-418C-8791-93EF573A7569 avatar
    9934 posts
    Member since:
    Nov 2016

    Posted 27 Aug 2007 Link to this post

    Hello Zeo,

    Thank you for posting this enhanced version of the knowledge base article in this code library thread. I have added 2500 Telerik points to your account for sharing it with the rest of Telerik community.

    And keep posting ;)

    Best regards,

    Stephen

    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center
Back to Top

This Code Library is part of the product documentation and subject to the respective product license agreement.