Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Button event and GridView for Report View modes: 
User avatar
Member
Member
marco-p - 7/19/2011 11:00:08 AM
   
Button event and GridView for Report
Hi,
I'm trying to export a report, and I need a gridview or a Unigrid.
I found that data are printed with a Gridview in ReportTable.ascx.
I put a button on that file and write the onClick event. but when i click the button nothing happpens and in debug the event is never reached.
I didn't change anything else.

Someone know why the event is never runned?
Do I have the wrong idea?

Thanks in advance.

User avatar
Member
Member
kentico_michal - 7/20/2011 8:19:14 AM
   
RE:Button event and GridView for Report
Hello,

You will need to check the Request.Form collection if it contains UniqueID of the button in the ReloadData method instead of using the OnClick handler - same functionality, but different approach, OnClick event is not used:


<asp:Button runat="server" ID="custombtn" Text="Click" />


public override void ReloadData(bool forceLoad)
{
.
.
.
if (!String.IsNullOrEmpty(Request.Form[this.custombtn.UniqueID]))
{
// custom code
}


Best regards,
Michal Legen

User avatar
Member
Member
marco-p - 7/21/2011 7:53:14 AM
   
RE:Button event and GridView for Report
Thank you, it works perfectly!