dear support.
I am including a gridweb object on a page which works great.
However, when I include a server side timer with an upodate panel, the gridweb becomes unresponsibe - eg I cant change to a different websheet anymore.
the aspx page is a s follows :
<%@ Page Language=“VB” AutoEventWireup=“false” CodeFile=“Default.aspx.vb” Inherits="_Default" %>
<%@ Register assembly=“Aspose.Cells.GridWeb” namespace=“Aspose.Cells.GridWeb” tagprefix=“cc1” %>
Mijn aspose webpagina
<asp:ScriptManager ID=“ScriptManager1” runat=“server”></asp:ScriptManager>
<asp:Button ID=“Button1” runat=“server” Text=“Refresh” />
<asp:UpdatePanel ID=“UpdatePanel1” runat=“server”>
<asp:Timer runat=“server” id=“Timer1” Interval=“10000” OnTick=“Timer1_Tick”></asp:Timer>
<asp:Label runat=“server” Text=“Page not refreshed yet.” id=“Label1”></asp:Label>
<cc1:GridWeb ID=“GridWeb1” runat=“server” Height=“330px” Width=“637px” OnRowDoubleclick=“GridWeb1_RowDoubleClick” OnCellDoubleClick=“GridWeb1_CellDoubleClick”></cc1:GridWeb>
</asp:UpdatePanel>
Within the server side code, I have added
Protected Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Label1.Text = "Panel refreshed at: " + DateTime.Now.ToLongTimeString()
Button1_Click(Nothing, Nothing)
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
GridWeb1.WebWorksheets(0).Cells(“D1”).PutValue(Now)
stijl = GridWeb1.WebWorksheets(0).Cells(“D1”).GetStyle
stijl.Custom = “hh:mm:ss”
GridWeb1.WebWorksheets(0).Cells(“D1”).SetStyle(stijl)
End Sub
So as soon as the timer fires, I cant edit the gridweb anymore ( eg change sheet )
Any ideas ?
thnaks for your much supported help,
guido
Hi Guido,
Thank you for sharing the code snippets. I have evaluated the presented scenario while using the latest version of Aspose.Cells.GridWeb 16.10.0, and I have managed to replicate the said issue on my side. In order to further investigate the matter, I have logged this incident as CELLSNET-44825 in our bug tracking system. Please spare us little time to further analyze the case and revert back with updates in this regard.
Hi again,
This is to update you regarding the ticket logged earlier as CELLSNET-44825. First of all, please note that you need to call the GridWeb’s load script every time the page is refreshed. We have found a way to call the JavaScript after the UpdatePanel gets changed, however, we strongly suggest you to do your own research on the topic in order get better understanding of the said scenario.
Furthermore, we suggest to use the client side refresh to update the date time value. Firstly, get the server side time then update the time in JavaScript.
The rate at which time changes should essentially be same so send the remaining time down to the client, and then let the client add that time to the current time at first page load. Later you can use the JavaScript to update the cell value. Please refer to the article on
how to write client side scripts as well as a StackOverflow inquiry on
how to sync JavaScript time with server.
private void Page_Load(object Sender, EventArgs e)
{
if (!Page.IsPostBack && !GridWeb1.IsPostBack)
{
var webcell = GridWeb1.WorkSheets[0].Cells["D1"];
webcell.PutValue(DateTime.Now.ToLongTimeString());
var stijl = webcell.Style;
stijl.Custom = "hh:mm:ss";
webcell.Style=(stijl);
}
}
seems all very complicated for such a basic requirement.... I cant image that you need client side scripts to accomodate a server side timer that fires - this is just not reasonable.
Also, your suggestion to use client side scription is not feasible as the content of cells is only available on the server - it is not available on the client,.
Will you adjust the object to allow for timed updates with only server side coding ? I believe this is the only way forward - the suggested solution is really just a workaround which wont work.
So basiocally, I want to be able to push information from the ASP server into the client's gridweb, even without the client doing anything ( no client side events being fired ) - so there cannot be any client javascript involved.
If this is not possible, then the use of the gridweb seems very limited to me, and i will have to revert to other technologies for this application.
Thanks for your much appreciated suggestions, guido
Hi Guido,
Thank you for your feedback. Let me discuss this matter with concerned member of the product team and get back with updates in this regard.
Hi again,
This is to further update you on the ticket logged earlier as CELLSNET-44825. Please note, the current implementation of Aspose.Cells.GridWeb component needs the client JavaScript to cooperate with the server-side view for its working. Especially, all user interactions are based on client-side JavaScript, such as insertion of a cell value. That is the reason we suggested you to use the JavaScript to handle this situation. Anyway, if you need a read-only view for the GridWeb, we can improve it by using only server-side code. This will take some time and we will be able to share the ETA after feasibility analysis.
thanks for your much appreciated assistance.
specially, all user interactions are based on client-side JavaScript, such as insertion of a cell value. That is the reason we suggested you to use the JavaScript to handle this situation.
The scenario I was describing doe not involve any user interaction at all - it involves just a timer that is firing on the server side and data that is pushed from the server into the client.
Anyway, if you need a read-only view for the GridWeb, we can improve it by using only server-side code. This will take some time and we will be able to share the ETA after feasibility analysis.
I doubt that a readonly version of the gridviewer is ok, there will be case when the user will want to select a cell and modify some values, even when other cells are being updated from the server without any user intervention. The standard GridWeb should be able to accomodate this situation. Compare it with a normal ASP page - it would be ridiculous if updating a label when a server side timer fires would require inclusion of custom client side scripting.
May I suggest something - I think you should have a parameter on each Cell indicating whether it can be automatically updated from the server ( wityhout any custom client scipting obviously ) or whether it is updated by user interventions ( which would require custom clinet javascripts ). Then the origin of the data in the gridweb is clear.
I believe this would be a great addition to the gridweb and bring it multiple steps forward,
thanks for your consideration,
guido
Hi Guido,
Thank you writing back. I am afraid, there is no other way but to update/refresh the GridWeb from JavaScript in order to keep the interface interactive even after the timer has been fired. Please check the attached archive for an ASPX page which accomplishes your goal, that is; insert a value to a cell when timer fires as well as automatically update the GridWeb. If you haven’t already checked this approach, please give it a try on your side. Please note, I have tested the page against latest version of Aspose.Cells.GridWeb for .NET 16.10.0 & its corresponding JavaScript files.