We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Gridweb1.ModifiedCells still has old data on grid rebind

I have a save function on my gridweb, and I would like the ModifiedCells to refresh after I hit the save button because I have logic pertaining to ModifiedCells.

Currently, when I hit the save button I just bind my Data to the grid again. However, this does not reset the Gridweb1.ModifiedCells.
How do I reset this?

I tried Gridweb1.ModifiedCells.Clear() right after I saved the data, but when I do a post-back the Gridweb1.ModifiedCells are populated and did not clear…

Below is how I look through modified cells.

foreach (WebCell cell in CreditGrid.ModifiedCells)
{
}

Hi,

I have logged your problem in our database. We will help you as soon as possible with sample code.

This issue has been logged as CELLSNET-40163.

Thank you!

Hi,


We appreciate if you could post us a sample project/application, zip it and post it here to show the issue, we can better understand your issue and figure it out accordingly too.

Thank you.

I am unable to provide you with a sample project that replicates the issue, and the project that this happens on is rather large.

I can provide you with more information though… I notice that this happens only after I make changes to a certain column. All other columns on the grid web work fine.

It seems like the modifiedcells is not being cleared if I do a postback after making changes to bound column 15…

I have some other examples of the issue.

If I make a change to column 16 and do a post back, the modifiedcells will be empty after the post back. If I do a post back after modifying column 15 and 16 the both columns will not be cleared from the modifiedcells . It seems like column 15 is triggering something that does not allow the modifiedcells to be cleared.

I would be willing to do a TeamViewer session is necessary.

Hi,

I am afraid, I as said earlier, we have to do certain tests for your described issue, We also need more details and information regarding your issue. We still request you to kindly supply to us an example, we think you can create a sample project/application with your dummy data etc. We do not need your original or complete project, so that we could reproduce the issue on our end and may evaluate your issue accurately to figure it out.

Thank you.

I was able to replicate the issue, and will be providing a sample shortly.

This problem occurs when I create an outlook appointment by downloading an ics. file.

I have attached the sample project.

When the first column is modified it will set up an outlook appointment and prompt you to download an ics file. You can hit cancel if you want, for the download.

After the first column is modified, you can see that ModifiedCells will never be cleared again after a post-back.

Hi,


Thanks for the sample project,

I have logged it and we will look into it soon.

Thank you.
Hi,

Please try our latest version of Aspose.Cells.GridWeb v2.7.0.2000, it resolves your issues as we tested.

Download the latest msi installer of Aspose.Cells for .NET package and get/find the latest version v2.7.0.2000 of GridWeb to try it in your scenario:
http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry342530.aspx


Thank you.

The new version did not resolve my issue. I will attach a sample project with the new version of aspose.
I am using Internet Explorer 9, and more detailed instructions to recreate the issue can be found below:

1) put a value in cell B1 and click save. (Nothing happens as intended)

2) put a value in Cell A1 and click save. This will prompt you download an ICS file.(Which only should happen when Column A is modified)

3) Do not edit any cells and click save again. This prompts you to download and ICS file even though you did not edit any cells(NOT INTENDED). This happens because Modified Cells is not cleaned.

Hi,

Thanks for the project.

After an initial test I can notice the issue. I tested your new project and found the issue as you mentioned. I have logged your project with your comment to attach with your issue into our issue tracking system (database). We will soon investigate your issue.

Thank you.

Hi,


We have fully tested your sample file again, at last we found the following code

Response.ContentType = "text/calendar";

Response.AddHeader("content-disposition", "attachment; filename=Appointment.ics");

Response.Write(sbICSFile);

When user set the ContentType and add header for file download , the browser will stop response for page reload, it is the default workflow of all browsers

Currently we can supply to your a solution to solve the your question

add the follow javascript code to page

<script type="text/javascript">

$(document).ready(function () {

$('#CreditGrid_SAVE').bind("click", function(){

CheckFileDownload();

});

});

var pageLoadCheckTimer;

function CheckFileDownload() {

var token = new Date().getTime(); //use the current timestamp as the token value

$('#download_token_value').val(token);

pageLoadCheckTimer = window.setInterval(function () {

var cookieValue = $.cookie('fileDownloadToken');

if (cookieValue == token)

finishDownload();

}, 1000);

}

function finishDownload() {

window.clearInterval(pageLoadCheckTimer);

$.cookie('fileDownloadToken', null); //clears this cookie value

document.getElementById("__EVENTARGUMENT").value = "";

document.getElementById("__EVENTTARGET").value = "";

document.getElementById("CreditGrid_XMLDATA").value = "";

theForm.submit();

}

</script>

Add “input” to page

<input id="download_token_value" name="download_token_value" type="hidden" />

For the server side ,add the follow code to page
Response.AppendCookie(new HttpCookie("fileDownloadToken", Request.Form["download_token_value"]));

It will work.

By the way, we have also added an attachment for you to test , when run the sample , please ,add “Aspose.Cells.GridWeb.dll” to bin directory.

This solution worked perfectly. Thank you for your help!