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

Pass custom arguments with toolbar button command

1 Answer 84 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 29 Sep 2011, 12:14 PM
Hello,
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?"));
                return;
            }
Is there a way to add custom arguments to command from clientside before postback and ItemCommand event?
Thank you

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 21 Oct 2011, 02:07 PM
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.
Tags
ToolBar
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or