Pass custom arguments with toolbar button command

2 posts, 0 answers
  1. Dmitry
    Dmitry avatar
    121 posts
    Member since:
    Jul 2010

    Posted 29 Sep 2011 Link to this post

    I use toolbar as a control inside CommandItemTemplate for RadGrid. One of buttons has CommandName="DeleteSelected". I can select rows only from clientside. How do I pass row IDs to CommandArgument from clientside?
    That's how I use the button:
    <telerik:RadToolBarButton runat="server" ImageUrl="~/images/btnDel.png" Value="delete"
                CommandName="DeleteSelected" Enabled="false"/>

    function ToolbarClientButtonClicking(sender, args) {
                if (args.get_item().get_value() == "delete") {               
                     args.set_cancel(!confirm("Delete selected rows?"));
    Is there a way to add custom arguments to command from clientside before postback and ItemCommand event?
    Thank you
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 21 Oct 2011 Link to this post

    Hello Dmitry,

    If you want to access the selected items from the RadGrid during the ItemCommand event, all you need to do is access the SelectedItems property of the RadGrid. You can then access whatever information your want from the GridItem.

    I hope that helps.
Back to Top