GridWeb rendering problems

Hi,

Thank you for your answer,

With the new GridWeb version, I do not have the Javascript onclick issue anymore but unfortunatly I still have my rendering problem…

Here are my browser configurations :

  • browser mode : IE9
  • document mode : IE9

Waiting for your help,

Thanks,

Romain.


Hi,


Thanks for providing further details and feedback.

We have logged your comments to attach with your existing issue “CELLSNET-40810”.
Our concerned developer will look int it and we will get back to you soon.

Thank you.

Thank you,

Meanwhile , I just want to ask you another question. I’m trying to get the current worksheet (mouse) selected cells in a server side function. The event is fired on an ASP button click. My code line is :

WebCells webCells = (WebCells)(GridWeb1.SelectCells[GridWeb1.ActiveSheetIndex]);

However, the field SelectCells is always null

I don’t know if my code is correct so i ask you an advice. I’ve seen this post however it’s does not help me that much.

Thanks,
Romain


Hi,

I think you need to register your ASP.NET button to sink events to obtain GridWeb data. Please add a line in the Page_Load event, e.g
button1.Attributes["onclick"] = "GridWeb1.updateData(); return GridWeb1.validateAll();";
Now Select a cell in the GridWeb. In the button's click event, you may add the code like:
int r = ((WebCell)((ArrayList)GridWeb1.SelectCells[0])[0]).Row;
int c = ((WebCell)((ArrayList)GridWeb1.SelectCells[0])[0]).Column;


Thank you.

Hi,

Thanks for your answer it works now. SelectCells is not null anymore.

However I need to get the selected cells in a WebCells object collection. The code bellow does not work :

WebCells webcells = (WebCells)((ArrayList)GridWeb1.SelectCells[GridWeb1.ActiveSheetIndex]);

Please is there a possibility to do that ?

Thanks,
Romain

Hi,


Well, I am afraid, for the SelectCells attribute of GridWeb, you can specify row/col indices but not worksheet’s index/id.

Thank you.
Hi,

lswe:


With the new GridWeb version, I do not have the Javascript onclick issue anymore but unfortunatly I still have my rendering problem...

Here are my browser configurations :
  • browser mode : IE9
  • document mode : IE9

Waiting for your help,

Thanks,


We have further reviewed your code, but we still could not reproduce the bug/issue, so, we recommend please check your code again and make sure that you are using latest version of the product and update the acw_client folder files.


Thank you.

Hi,

I’m sorry for that long period of silence but I was unable to answer to you in the last while.

If I have to specify the row/col indices then I can’t understand the difference between :

WebCells webcells = (WebCells)((ArrayList)GridWeb1.SelectCells;
and
WebCells webCells = GridWeb1.WebWorksheets[0].Cells;

Perhaps you could help me with that.

I asked that question because I need to get only the cell values which are selected by the user.

So is there a possibility to do that with the gridweb control ?

Thank you.

Hi,

About the rendering issue, I tried to fix it by using the 2.7.10.2001 gridweb version. However I still have the problem.

To be sure that the problem is not caused by my own computer, I tried to execute that project on another computer and the bug was reproduced too.

I really don’t know what to do to fix it…

Thanks,
Romain.

Hi,

lswe:


If I have to specify the row/col indices then I can't understand the difference between :

WebCells webcells = (WebCells)((ArrayList)GridWeb1.SelectCells;
and
WebCells webCells = GridWeb1.WebWorksheets[0].Cells;

Perhaps you could help me with that.

I asked that question because I need to get only the cell values which are selected by the user.


Well, GridWeb.SelectCells is used to retrieve the selected cells on the GridWeb a user selects. When you use GridWeb.WebWorksheets[0].Cells --> it refers to get all the initialized cells of the worksheet.

Thank you.

Hi,

lswe:


About the rendering issue, I tried to fix it by using the 2.7.10.2001 gridweb version. However I still have the problem.

To be sure that the problem is not caused by my own computer, I tried to execute that project on another computer and the bug was reproduced too.

I really don't know what to do to fix it...


We are sorry but I am afraid we still could not find your issue. We tried several times and on different machines but we could not find your issue. We used IE (version, 8,9 etc.), FireFox, Google Chrome and other browsers and it works fine on everywhere.
It looks really strange that it does not works fine on your end. We have re-opened your issue again. Once we have any update on it for you, we will let you know here.

Thank you.

Hi,

Thank you for your help,

Now, I understand the difference.

Thanks,
Romain

Hi,

Amjad Sahi:

Well, GridWeb.SelectCells is used to retrieve the selected cells on
the GridWeb a user selects. When you use GridWeb.WebWorksheets[0].Cells
–> it refers to get all the initialized cells of the worksheet.

When I’m trying to cast it by using ArrayList as you advised me in your previous post, the compiler display that’s it’s impossible to cast a WebCellArea in ArrayList.

So when I’m using the SelectCells field the only one thing I can have is a WebCellArea Object. That one can give me the bound of my selection.

Thereby taking account of that, is there a possibility to build with the GridWeb API a WebCells collection by using that bound?

Amjad Sahi:

We are sorry but I am afraid we still could not find your issue. We
tried several times and on different machines but we could not find
your issue. We used IE (version, 8,9 etc.), FireFox, Google Chrome and
other browsers and it works fine on everywhere.
It looks
really strange that it does not works fine on your end. We have
re-opened your issue again. Once we have any update on it for you, we
will let you know here.


About my rendering issue, I hope you will reproduce the bug and you will give me some news.

Thanks,
Romain

Hi,

lswe:

When I'm trying to cast it by using ArrayList as you advised me in your previous post, the compiler display that's it's impossible to cast a WebCellArea in ArrayList.
So when I'm using the SelectCells field the only one thing I can have is a WebCellArea Object. That one can give me the bound of my selection.
Thereby taking account of that, is there a possibility to build with the GridWeb API a WebCells collection by using that bound?


I tested your scenario with a sample test case using the latest version v2.7.9.xxxx of GridWeb and found the issue as you have mentioned.

I can find the exception: Unable to cast object of type 'Aspose.Cells.GridWeb.Data.WebCellArea' to type 'System.Collections.ArrayList' using the following code. I just select a few cells on the GridWeb and process the code, it gives me error as you pointed out.

Sample code:
e.g

//I placed an ASP.NET button named Button1. In Page_Load event, I placed a simple code segment. I imported a simple file and then did sink events for the button's click.

protected void Page_Load(object sender, EventArgs e)
{
//if first visit this page clear GridWeb1
if (!IsPostBack)
{

GridWeb1.WebWorksheets.ImportExcelFile("e:\\test2\\List.xls");
Button1.Attributes["onclick"] = "GridWeb1.updateData(); return GridWeb1.validateAll();";
}
}


protected void Button1_Click(object sender, EventArgs e)
{
if (GridWeb1.SelectCells != null && GridWeb1.SelectCells.Count > 0)
{
int sRow = ((WebCell)((ArrayList)GridWeb1.SelectCells[0])[0]).Row; //Exception raised here.
int sCol = ((WebCell)((ArrayList)GridWeb1.SelectCells[0])[0]).Column;
int eRow = ((WebCell)((ArrayList)GridWeb1.SelectCells[GridWeb1.SelectCells.Count - 1])[0]).Row;
int eCol = ((WebCell)((ArrayList)GridWeb1.SelectCells[0])[GridWeb1.SelectCells.Count - 1]).Column;


for (int i = sRow; i <= eRow; i++)
{
for (int j = sCol; j <= eCol; j++)
{
Response.Write("Cell: " + GridWeb1.WebWorksheets[GridWeb1.ActiveSheetIndex].Cells[i, j].Name + " Value: " + GridWeb1.WebWorksheets[GridWeb1.ActiveSheetIndex].Cells[i, j].StringValue);
}
}



}

I have logged a ticket with an id: CELLSNET-41070 for your issue. We will look into it soon.

Thank you.
lswe:
Hi,

When I'm trying to cast it by using ArrayList as you advised me in your previous post, the compiler display that's it's impossible to cast a WebCellArea in ArrayList.

So when I'm using the SelectCells field the only one thing I can have is a WebCellArea Object. That one can give me the bound of my selection.

Thereby taking account of that, is there a possibility to build with the GridWeb API a WebCells collection by using that bound?

About my rendering issue, I hope you will reproduce the bug and you will give me some news.

Thanks,
Romain

Hi,

We have checked the source code.

The data type of GridWeb1.SelectCells is ArrayList, and data type of its’ child is WebCellArea

WebCellArea wca=(WebCellArea)GridWeb1.SelectCells[0];

If we only select one cell , the selected cell is

WebCell cell = GridWeb1.ActiveCell;

mshakeel.faiz:


We have checked the source code.

The data type of GridWeb1.SelectCells is ArrayList, and data type of its’ child is WebCellArea

WebCellArea wca=(WebCellArea)GridWeb1.SelectCells[0];

If we only select one cell , the selected cell is

WebCell cell = GridWeb1.ActiveCell;



Hi,

I understand how to get a WebCellArea but my question was :

lswe:

Thereby taking account of that, is there a possibility to build with the GridWeb API a WebCells collection by using that bound?


I am waiting for your help.
Thanks.
Romain.
lswe:

Thereby taking account of that, is there a possibility to build with the GridWeb API a WebCells collection by using that bound?
Hi,

We are not sure about your needs. Please elaborate yourself more.

Hi,

Here is my code now :

List webcells = new List();
WebCellArea wca = (WebCellArea)GridWeb1.SelectCells[0];
for (int i = wca.StartRow; i <= wca.EndRow; i++)
{
for (int j = wca.StartColumn; j <= wca.EndColumn; j++)
{
webcells.Add(GridWeb1.WebWorksheets[GridWeb1.ActiveSheetIndex].Cells[i, j]);
}
}
WebCells webCells = (WebCells)webcells;

As you can see, first, I get the WebCellArea which is in fact the bound of my user select. Then, I get all the WebCell selected and I add them in an Array of WebCell.
Finally, I try to cast the List to a WebCells object and obviously it does not work.

My question was :

Is there a possibility to do that in another way with the aim of having at the end a WebCells object?

Thanks,
Romain.

Hi,

Thanks for your sample code.

I found that WebCells constructor is hidden due to protection level, so you cannot cast it into WebCells.

Why do you want to cast the List into WebCells? You can just use the List for your needs.

mshakeel.faiz:
Hi,

Thanks for your sample code.

I found that WebCells constructor is hidden due to protection level, so you cannot cast it into WebCells.

Why do you want to cast the List into WebCells? You can just use the List for your needs.


Hi,

I was just asking that question because I wrote some methods which handle WebCells object but indeed if there is no solution to do that, I will adapt that methods to deal with a List of WebCell.

Thank you for your help,
Now I wait for your help about the GridWeb rendering issue.

Best regards,
Romain.