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

RadGrid - Custom fire command with empty grid

1 Answer 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MathieuB
Top achievements
Rank 1
MathieuB asked on 27 Mar 2019, 01:01 PM
Hi,
    In my RadGrid, I have a Custom RadToolbar for implement my actions. Inside this toolbar I have a RadButton
<telerik:RadToolBarButton   Text="<%$ Resources:AdminLoc, btnAddDailyEquipment %>"
ImageUrl="~/Web/Images/Icons/ress_equipement.gif"
Group="DailyEquipment" CommandName="AddDailyResource" CommandArgument="DailyEquipment"
Value="DailyEquipment" Visible="<%# KeyValueTools.GetActivitekRepentignyDev %>">


My  Toolbar implement the OnClientButtonClicked attribute who calling a JS function with this code
case "AddDailyResource":<br> $find('<%= RgPanelSummary.ClientID%>').get_masterTableView().fireCommand(args.get_item().get_commandName(), argument);<br>        break;


If I have more than one element in my grid. The server-side ItemCommand is fired

But my problem occuring when I have no data in my RadGrid. The server-side called the ItemDataBound (RadGrid), the PageLoad, PageRender, etc. But the ItemCommand is never called. I have this problem for each custom action "Print, DailyEquipement". But If I using a default Radgrid action (DeletedSelected, InitInsert) the ItemCommand is called.

Can I resolve my problem? And If Yes how ?
Thank you and have a good day



1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 01 Apr 2019, 11:12 AM
Hi Mathieu,

Yes, this is correct and mentioned in the following article:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridtableview-object/methods/firecommand

You can use hidden button to call its .click() method or implement your own _doPostback to achieve this requirement when the grid has no items.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
MathieuB
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or