Free Support Forum -

GridWeb Cell's vertical align


I am using the Aspose.Cells.GridWeb (version 20.3.8) component and came across an issue with the VerticalAlign property of the cells’ style. It seems to be ignored.

I set the style in the following way:

            GridTableItemStyle st = new GridTableItemStyle();
            st.VerticalAlign = VerticalAlign.Middle;
            st.Height = new Unit(100, UnitType.Percentage);
            grid.ActiveSheet.Cells.SetRowHeightPixel(0, 50);
            grid.ActiveSheet.Cells.SetStyle(0, 0, 1, 10, st);

But the cell’s content is always displayed on top:
image.png (2.2 KB)

I also tried using the CssClass property with the vertical align defined on the Css but I obtained the same result. Setting the style using the Style property of the cell also does not help.

Here is a sample project with this problem: Sample Project

Something strange I notice is that, if I set the EditMode property of the grid to true, the content is initially displayed on top, but after clicking a cell it moves to the middle.

I appreciate any help you could offer.

We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSNET-47294 – Vertical alignment not effective in GridWeb


You need to set “needInitAlignmentAdjust=true” in acwmain.js resource file. Since it takes a little time cost for init, so the default value is set as false. Please set this attribute to true in acwmain.js file and re-save the file and give it a try again, it should work fine.

Hi, Thanks for the reply and solution.
It does align cells vertically.

However, unfortunately, I don’t think our users will accept having to wait for the loading to complete only for the alignment to be made. On every post back.
In order to use this option I have to disable the loading panel so it does not overlap the popups that are opened. And still it is not pleasant to see the page constantly changing.

We are upgrading from a very old version of Aspose.Cells.Grid (version 2.7.5). As you can see from my sample project here: Sample project, the alignment does not require extra loading.

Is there anything else I can do?



Thanks for your feedback and sample project.

We will evaluate your issue further and try to figure it out soon.

Please try our latest version/fix: Aspose.Cells GridWeb v20.4.3: (5.3 MB)

Your issue logged should be fixed in it.

Thank you,
It is quite noticeable the improvement on loading time for the alignment.


Good to know that your issue is sorted out by the new fix. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

The issues you have found earlier (filed as CELLSNET-47294) have been fixed in Aspose.Cells for .NET v20.5. This message was posted using Bugs notification tool by Amjad_Sahi