ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"> </telerik:RadWindowManager> <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript"> var lastClickedItem = null; var clickCalledAfterRadprompt = false; var clickCalledAfterRadconfirm = false; function onClientButtonClicking(sender, args) { if (args.get_item().get_text() == "Order another beer") { if (!clickCalledAfterRadconfirm) { args.set_cancel(true); lastClickedItem = args.get_item(); radconfirm("Are you sure? You order it, you finish it!", confirmCallbackFunction); } } } function confirmCallbackFunction(args) { if (args) { clickCalledAfterRadconfirm = true; lastClickedItem.click(); } else clickCalledAfterRadconfirm = false; lastClickedItem = null; } </script> </telerik:RadCodeBlock> <CommandItemTemplate> <telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientButtonClicking="onClientButtonClicking" OnButtonClick="RadToolBar1_ButtonClick" Width="100%"> <CollapseAnimation Duration="200" Type="OutQuint" /> <Items> <telerik:RadToolBarButton CommandName="OrderBeer" runat="server" Text="Order another beer"></telerik:RadToolBarButton> </Items> </telerik:RadToolBar> </CommandItemTemplate>
The CommandItemTemplate part you obviously need to add to your MasterTableView element..
CS:
protected void RadToolBar1_ButtonClick(object sender, RadToolBarEventArgs e) { RadToolBarButton button = e.Item as RadToolBarButton; if (button.CommandName == "OrderBeer") { \\Do stuff, drink the beer \\DrinkBeer(); } }
Have a nice weekend folks!!!