GridWeb reload page on tab click

Hi,

I’m using the GridWeb control for ASP.NET (version : 2.7.5.2000) in an web application which is intented to load an Excel workbook and then allow user to have some specific interactions with it.

Because that one often needs to interact with a database, I have to use asynchronous server requests (AJAX). Moreover, I’m using Javascript to store useful information and to catch OnCellSelected event.

At this point, I have some troubles with the behaviour of the Grid. Each time I click on a worksheet tab, the hole page is reloaded (page_init() invocation). To fix that problem, I tried to put an UpdatePanel around the Grid but it doesn’t work. After just one tab click, the grid becomes unusable… Moreover, i tried to set the EnableAjax property to true but the problem is the same ( page_init() is still invoked).

Obviously, each time the page is reloaded, I loose all the information I store on client side with Javascript.

I hope you will advise me.
Thanks,
Best regards,
Romain

Hi,

Thanks for your posting and using Aspose.Cells for GridWeb.

Please download and use the latest version:
Aspose.Cells
for GridWeb v2.7.6.2003


Please provide us your sample project replicating your problem so that we could look into your issue and help you.

Hi,

I’m using now the latest version:
Aspose.Cells
for GridWeb v2.7.6.2003
but my problem is still here.

My application is too huge to be sent so I’ve attached a sample coding which describe the problem. In that sample, I only set the attribute EnableAJAX to true. If I try to use an UpdatePanel like this :

<asp:ScriptManager runat=“server” ID=“ScriptManager” />
<asp:UpdatePanel runat=“server”>

<acw:GridWeb ID=“GridWeb1” runat=“server” Width=“100%” Height=“100%” ShowLoading=“true”
PresetStyle=“Standard” OnSheetTabClick=“LoadPanel” OnGridInitClientFunction=“displayWorksheetInfo”>
</acw:GridWeb>

</asp:UpdatePanel>

if I click on tab button, it will change the current worksheet and then the grid is frozen.

In addition to that problem, I have since I got the last version, some rendering troubles. Indeed, now the text overfill the cells…

I’m waiting for your help.

Thanks,
Romain

Hi,

We have tested your demo, maybe you should add ispostback check to page_load method and also if the you want to use ajax for gridweb, you should use if (Request.PathInfo != “/acw_ajax_call”), for example:


C#


protected void Page_Init(object sender, EventArgs e)

{


if (Request.PathInfo != “/acw_ajax_call”)

{


Trace.Write(“Each time I click on tab button, Page_Init is invoked”);


StringBuilder sb = new StringBuilder();


sb.Append(“var test = new Array(); var tabName ;”);


///sb.Append(“alert('Page_Init is invoked, the variable is set to '+test);”);


CacheScript(Tuple.Create<string, string>(“instanciation”, sb.ToString()));


}

}



protected void Page_Load(object sender, EventArgs e)

{


if (!IsPostBack)
{

LicenceManager.SetAsposeLicense();


GridWeb1.WebWorksheets.AutoFitRows = true;



LoadData(Server.MapPath("~") + “workbook/P&L social_5.xlsm”);



StringBuilder sb = new StringBuilder();


sb.AppendFormat(“tabName = {0}”, GridWeb1.WebWorksheets.ActiveSheet.Name);


CacheScript(Tuple.Create<String, String>(“modification”, sb.ToString()));

}

}

Hi,

Thank you for your answer, I will use that condition now.

But the problem is not fixed because Tab button click is still not considered as a Postback.

In fact, the behaviour is quite weird. When I set the attribute EnableAJAX to true, on tab click, the variable IsPostBack from the Page is set to false and the page is partially reloaded and when I set it to False, the variable IsPostBack is set to true, but the page is fully reloaded.

Moreover, I have a server side method LoadPanel which is fired on SheetTabClick :

private void LoadPanel(object sender, EventArgs e)
{
System.Text.StringBuilder script = new System.Text.StringBuilder();
script.Append(@"");
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), tuple.Item1, script.ToString(), false);
}

EnableAJAX= true -> the javascript alert is not displayed
EnableAJAX= false -> the javascript alert is displayed

I tested the same code on a button onclick event, it always work perfectly, the javascript alert is displayed.

Otherwise, is there an explanation about the fact that the Control doesn’t work after I put an UpdatePanel around it ?

Moreover, is there a way to fix that rendering troubles in IE9 ? I’ve attached you a capture which illustrate the problem.

Thanks,
Romain

Hi,

Thanks for your feedback and using Aspose.Cells for GridWeb.

We need to investigate this issue so we have logged this issue in our database. We will look into your issue and update you asap.

Your comments has been logged against the issue id: CELLSNET-40711

Hi,

Do you have some news about my troubles ?

Thanks,
Romain,

Hi,


I am afraid but we are currently having no information about the resolution of this issue. However, I am forwarding your concerns to our development team to get the status of work on the issue. We will let you know ASAP when we get an update about this issue. We appreciate your patience in this regard.

Hi,

Thank you for your answer,

I have a question which could made me look for another way to fix my trouble.

Is there a possibility to put around the GridWeb an UpdatePanel ?

Thanks,

Hi,

Thanks for your question.

We are looking your issue and give you advice asap.

I have also logged your comment against the issue id: CELLSNET-40740.

Hi,

Still no answer from your development team ? That issue is very annoying for me and slows my development work.

Hope to have a solution very soon.

Thank you,
Romain

Hi,

We have checked again your sample file, for the
client’s method “OnGridInitClientFunction=displayWorksheetInfo”, it will be called
when the grid init , but before Page_Load method

For the client , you can use
custom method in the method OnSheetTabClick=“LoadPanel”, change the LoadPanel
method .

Hope it is helpful for you.

Hi,

We do not suggest to use UpdatePanel, since that once it is used, some default function will not be called sometimes.

When updatePanel is used, the default function: new acwmain(document.getElementById(‘GridWeb1’)) does not get called. User must call it manually.

But for the user, he can use “EnableAjax=true”in GridWeb and filter all ajax calls by the following method:

if (!Page.IsPostBack && Request.PathInfo != “/acw_ajax_call”)
{

}

Please also see this thread.
Still having issues with GridWeb and UpdatePanel


Hi,

Thank you for your answer, i will try to deal with that.

Best regards,
Romain

Hi,

Hopefully, the code will be helpful in dealing with this problem.

Please feel free to post, if you encounter any other problem, we will be glad to assist you. Thank you.