Freeze First Row on GridWeb

How do I freeze a specific row on GridWeb (Displaying on web)

Here I have remove the Header and I want to display the first row as header. Because the header need to be editable. But when I am using the following code it does not freeze the first row in Web Page. Means when I am doing vertical scrolling the first row becomes hide.

WebWorksheet sheet = asposeGrid.WebWorksheets[asposeGrid.ActiveSheetIndex];
sheet.FreezePanes(1, 1, 2, sheet.Cells.MaxColumn);

So how do I achieve the functionality?

Hi,

Well, I have tested your scenario and it works fine.

I imports an excel file to the GridWeb and then freeze the first row, it works fine and same as MS Excel.

Here is my sample code:
GridWeb1.WebWorksheets.Clear();
GridWeb1.ActiveSheetIndex = 0;
GridWeb1.WebWorksheets.ImportExcelFile(“e:\test\MyFile.xls”);
//Freeze the first row.
GridWeb1.WebWorksheets[0].FreezePanes(1, 0, 1,GridWeb1.WebWorksheets[0].Cells.MaxColumn);

//Or
// GridWeb1.WebWorksheets[0].FreezePanes(1, 0,
1, 0);

I am using latest version v2.2.0.2000. Please try the latest version. If you still find the issue, kindly create a sample project to show the issue.

Thank you.

Thank you for your prompt reply.

Here I am creating a sample test project. But the grid does not show here. I have checked it using firebug and the following files are not being loaded. Though the same code running fine on another running project.

http://localhost:1492/WebSite1/default.aspx/menu_l.css
http://localhost:1492/WebSite1/default.aspx/commonbehav.js
and lots more.

I have added the GridWeb.dll as reference and added the license code. Should I need to do something special on web.config? How do I know which version of aspose I am using. Is there any code to check the version? Actually My company purchased a aspose license but I don’t know the version of it.

Here is the following code I am using after creating a website project on VS 2008
//On Page Load

Aspose.Cells.GridWeb.License lic = new Aspose.Cells.GridWeb.License();
lic.SetLicense(“Aspose.Cells.lic”);
GridWeb1.WebWorksheets.Clear();
GridWeb1.ActiveSheetIndex = 0;
GridWeb1.WebWorksheets.ImportExcelFile(“F:\Test.xls”);
GridWeb1.WebWorksheets[0].FreezePanes(1, 0, 1, GridWeb1.WebWorksheets[0].Cells.MaxColumn);

//On Aspx File
<acw:GridWeb ID=“GridWeb1” runat=“server” style=“Height:348px” Width=“100%” XhtmlMode=“true”>

<acw:Worksheet ID=“Worksheet1” runat=“server” DataMember="" Name=“Sheet1”>
</acw:Worksheet>

</acw:GridWeb>

Can you please suggest me what to do?

Hi,

Well, to check the version number of Aspose.Cells.GridWeb, you may try:

System.Reflection.Assembly a = System.Reflection.Assembly.LoadFrom(“e:\test\Aspose.Cells.GridWeb.dll”);
Response.Write("Assembly Version Info: " + a.FullName);
Response.Write("Assembly .NET Runtime info: " + a.ImageRuntimeVersion);


For the issue regarding grid does not show. I am not sure about the following urls in web.config file.

http://localhost:1492/WebSite1/default.aspx/menu_l.css
http://localhost:1492/WebSite1/default.aspx/commonbehav.js

Please check each url if they referring to valid path and make sure they are referring to valid path.



Thank you.