I have an excel file with 5 worksheets. I have a few custom command buttons (next, prev etc.). On clicking the buttons I need to change the activeSheetIndex. With my code below, the page_load gets executed before the customCommand. How can I call the pageLoad after the custom command is executed?
static int activePage = 1;
protected void Page_Load(object sender, EventArgs e) {
GridWeb1.WebWorksheets.ActiveSheetIndex = activePage;
}
protected void GridWeb1_CustomCommand(object sender, string command) {
if (command.Equals("Start")) {
activePage = 1;
}
else if (command.Equals("Prev")) {
activePage--;
}
else if (command.Equals("Next") ) {
activePage++;
}
}
Thanks.