I would like to place my Export-to-Excel button within the toolbar.
This button should be defined as a synchronous postback trigger for my update panel.
The button is placed within CommandItemTemplate tags.
My problem is that the concept that has worked with other asp.net controls does not seem to work with RadGrid.
<asp:PostBackTrigger ControlID="myRadGrid$btnExport" />
In this type of declaration the error message I receive is the following:
A control with ID 'myRadGrid$btnExport' could not be found for the trigger in UpdatePanel 'UpdatePanel1'.
Can you please give me some suggestion?
8 Answers, 1 is accepted
There is templating in a lot of ASP.NET controls (such as FormView, GridView, etc.) where the ParentControlID$ControlWithinTemplateID formula works properly for declarative targeting.
This is why I am missing this.
use the RadGrid as your PostBackTrigger
I can't, because in this case I will lose the AJAX functionality provided by the grid.
These documents describe that Excel exporting only works with synchronous postbacks.
I understand this.
My problem is only connected with the template control targeting syntax.
Using this last approach it works now.
I am facing the same issue :(. I have already gone through the same link ans applied it However it gives me exception on the line mentioned below:
It gives me exception as it is not able to recognize the control. The error I get is that find no control.
I have used Commanditemtemplate and Itemcreated events and followed the same procedure.My data grid lies in the asp: update panel..
A help wd b greatful as I am stuck with this code for last 5 days .
Please make sure that the ID of your button matches the argument, passed to the FindControl method in the ItemCreated event handler.
the Telerik team