Hi Prithiraj,
Please try the following code:
foreach (WebWorksheet wrksht in grdWeb.WebWorksheets)
{
TreeNode twrksht = new TreeNode();
twrksht.Text = wrksht.Name;
int index = wrksht.Index;
twrksht.NavigateUrl = "BLOCKED SCRIPTreturn getWorksheet(" + index + ")";
tAssumption.ChildNodes.Add(twrksht);
}
function getWorksheet(index)
{
var sheet = document.getElementById("grdWeb_TAB" + index);
if (sheet != null)
sheet.click();
}
The id of worksheet in page is combined with name of GridWeb, the constant string “_TAB” and the index of the worksheet. Please check the source of the page for reference.
Thank you.
Amjad Sahi
Support Developer,
Aspose Sialkot Team
Contact Us