Hello !
Well after some investigation i found that i can add some entries in the right-click menu.
So i have added an Hide entry and a Display entry like this :
<agw:GridWeb id=“GridWeb1” runat=“server” XhtmlMode=“true” Height=“600px” Width=“100%” NoScroll=“false” EnableClientColumnOperations=“true” EnableClientMergeOperations=“true” EnableClientResizeColumnRow=“true” EnableClientRowOperations=“true” EnableClientFreeze=“true” OnCustomCommand=“GridWeb1_CustomCommand” OnSaveCommand=“GridWeb1_SaveCommand”>
<agw:CustomCommandButton runat=“server” Command=“Hide” Text=“Hide” CommandType=“ContextMenuItem”></agw:CustomCommandButton>
<agw:CustomCommandButton runat=“server” Command=“Display” Text=“Display” CommandType=“ContextMenuItem”></agw:CustomCommandButton>
</agw:GridWeb>
And catch the event in code behind like this :
protected void GridWeb1_CustomCommand(object sender, string command)
{
switch (command)
{
case “Hide”:
if (GridWeb1.ActiveCell != null)
{
int row = GridWeb1.ActiveCell.Row;
WebCells cells = GridWeb1.WebWorksheets[GridWeb1.ActiveSheetIndex].Cells;
cells.SetRowHeight(row, new Unit(0, UnitType.Point));
}
break;
case “Display”:
if (GridWeb1.ActiveCell != null)
{
int row = GridWeb1.ActiveCell.Row;
WebCells cells = GridWeb1.WebWorksheets[GridWeb1.ActiveSheetIndex].Cells;
cells.SetRowHeight(row, new Unit(10, UnitType.Point));
}
break;
}
}
For information my control is instancied with the below code. The Excel file contains 2 sheets and some formulas (by the way i am not able to navigate between the sheet included the Evaluation Copyright Warning sheet).
protected void Page_Load(object sender, EventArgs e)
{
//if first visit this page clear GridWeb1
if (!IsPostBack)
{
GridWeb1.WebWorksheets.Clear();
string filename = “C:\Documents and Settings\xxxxx\My Documents\xxxx\Proto.xls”;
GridWeb1.WebWorksheets.ImportExcelFile(filename);
GridWeb1.WebWorksheets.RunAllFormulas();
GridWeb1.EnableAJAX = true;
}
GridWeb1.WebWorksheets.RunAllFormulas();
}
But it doesn’t work and i don’t understand why. I try to debug and when i’m clicking on “Hide” on the menu it doesn’t run the GridWeb1_CustomCommand method.
Still on this right-click menu, how make the default features work ? I try to use the “Freeze” functionnality available in the menu but it does nothing and doesn’t freeze the lines i had selected.
I am using Internet Explorer 7 and can’t change (official browser in the company i work for).
Thanks for taking consideration into my issues !
Well i don’t know if it’s because i’m using IE7 but i have many issues with the context menu which doesn’t work and it seems to be related to EnableAjax = “true”.
But all the modifications (calculation formulas, freezing, hiding, etc.) have to be done without refreshing the page.
Is there some way to do this ? Does all context menu features will work if i don’t use Ajax refreshing ?
Hi,
Hi,
Thanks for your answer. I was absent that’s why i’m responding only today.
I have the last version of Aspose.Cells (including GridWeb).
I am trying to create a new blank project to do my tests and i will be back to you if i am still facing problems.
Hi,
Thanks for your posting.
Please feel free to post if you encounter any other issue, we will be glad to help you further.