iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,I apologize for the late response.Basically, we can’t use “Load on Demand” scenario or feature in (TreeView) node that already has children (child node).I attached a page that contains ASP.Net TreeView to show how the “Load on Demand” feature of ASP.Net TreeView works.In this page, I add “OnTreeNodePopulate” server side event to the TreeView control.On the “Page_Load” server side event, I create the root node for the TreeView:
protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack) { TreeNode rootNode = new TreeNode(); rootNode.Text = "Root"; rootNode.Value = "Level0"; rootNode.Expanded = true; rootNode.PopulateOnDemand = true; TreeView1.Nodes.Add(rootNode); } }
Then in “OnTreeNodePopulate” server side event I try to add two nodes with different depth level.
protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { TreeNode newNode = new TreeNode(); newNode.Text = "Level One"; newNode.Value = "Level1"; newNode.PopulateOnDemand = false; TreeNode newNode2 = new TreeNode(); newNode2.Text = "Level Two"; newNode2.Value = "Level2"; newNode2.PopulateOnDemand = true; newNode.ChildNodes.Add(newNode2); e.Node.ChildNodes.Add(newNode); }
With this configuration the ASP.Net TreeView will work properly. However, if you try to modify the “PopulateOnDemand” property, in “newNode”, to “True”.You will get the warning message while you are trying to expand the root node.I attached the video regarding the result on my end as well.As you can see, the Intersoft WebTreeView have the same default behavior with ASP.Net TreeView, that the “Load on Demand” scenario or feature can’t be applied in (TreeView) node that already has children (child node).Due to that behavior, in this Load on Demand scenario, the WebTreeView will only load the parent node, not with its child node.Hope this helps.Regards,Hans K.
Hello,I’m glad to hear that the JavaScript code suitable for your current scenario.Should you have further question, please do not hesitate to contact us.Thank you.Regards,Hans K.
Hello,Please forgive me for lack of understanding about the reported problem.I modified the JavaScript code by adding code to handle Left and Right key event.I add a new function that suitable with Left and Right key event:
function activateEditModeColumn(grid, curCellIndex, nextCellIndex, curRowIndex){ if (nextCellIndex >= 0 && nextCellIndex < grid.RootTable.Columns.length) { var curRowEl = grid.RootTable.GetRow(curRowIndex); var currCell = curRowEl.GetCell(curCellIndex); var nextCell = curRowEl.GetCell(nextCellIndex); grid.SetFocus(); currCell.Select(true); curRowEl.Select(); nextCell.ActivateEdit(); } }
I add a couple of line codes in WebGrid1_OnEditKeyDown function:
//if left arrow key else if (event.keyCode == 37) { grid.ExitEdit(1, 0, 0); intervalObj = setInterval(function () { if (!grid.IsInProgress) { activateEditModeColumn(grid, curCell - 1, curCell - 2, curRowIndex); clearInterval(intervalObj); intervalObj = null; } }, 5); } //if right arrow key else if (event.keyCode == 39) { grid.ExitEdit(1, 0, 0); intervalObj = setInterval(function () { if (!grid.IsInProgress) { activateEditModeColumn(grid, curCell - 1, curCell, curRowIndex); clearInterval(intervalObj); intervalObj = null; } }, 5); }
I attached the modified page as well. Please kindly have review on the page once again.Thank you.Regards,Hans K.
var intervalObj; function activateEditMode(grid, curRowIndex, nextRowIndex, columnName, cell) { if (nextRowIndex >= 0 && nextRowIndex < grid.TotalRows) { var nextRowEl = grid.RootTable.GetRow(nextRowIndex); var curRowEl = grid.RootTable.GetRow(curRowIndex); var cell1 = nextRowEl.GetCell(cell); var cell2 = curRowEl.GetCell(cell); grid.SetFocus(); cell2.Select(true); nextRowEl.Select(); cell1.ActivateEdit(); } } function WebGrid1_OnEditKeyDown(controlId, keyCode) { // get the grid var grid = ISGetObject(controlId); // get current information about row and cell var activeEditCell = grid.GetActiveEditCell(); var columnName = wgGetColNameByCell(activeEditCell.element); var curRow = activeEditCell.rowElement; var curRowIndex = curRow.rowIndex; var curCell = grid.GetActiveEditCell().cellIndex; if (keyCode == 38) { // if up arrow grid.ExitEdit(1, 0, 0); // exit and update the row if dirty intervalObj = setInterval(function () { if (!grid.IsInProgress) { activateEditMode(grid, curRowIndex, curRowIndex - 1, columnName, curCell - 1); clearInterval(intervalObj); intervalObj = null; } }, 5); } else if (keyCode == 40) { // if down arrow or enter key grid.ExitEdit(1, 0, 0); // exit and update the row if dirty intervalObj = setInterval(function () { if (!grid.IsInProgress) { activateEditMode(grid, curRowIndex, curRowIndex + 1, columnName, curCell - 1); clearInterval(intervalObj); intervalObj = null; } }, 5); } return true; }
I attached the page & video regarding this scenario. Please kindly have review on the attached file and let me know your response.Regards,Hans K.
function ExportRootTable() { var WebGrid1 = ISGetObject("WebGrid1"); //export grid data to Microsoft Excel WebGrid1.ExportGrid("Customers", "EXCEL", "PORTRAIT"); return true; }
Here’s snippet example code how to export the child table:
function ExportSelectedChildTable_Orders() { var WebGrid1 = ISGetObject("WebGrid1"); //export grid data to Microsoft Excel WebGrid1.ExportGrid("Orders", "EXCEL", "PORTRAIT", WebGrid1.GetSelectedObject().ToRowObject().GetParentRow().RowElement); return true; }
I attached the page that show how implement the JavaScript code.Please try to add the page to the WebGrid Samples Solution to see the result.Regards,Hans K.
Hello,Basically, this printing scenario (code for printing) is beyond Intersoft control itself.However, I will try to help you to find a work around for this printing scenario.I try to modify one of WebGrid Samples, EnableExporting.aspx page.In this page, I add OnExport server side event in the WebGrid and then I add a line of code to set the ReportName property.Here’s the example code:
protected void WebGrid1_Export(object sender, ISNet.WebUI.WebGrid.ExportEventArgs e){ e.ReportInfo.ReportName = "EnableExportingPage"; }
Next, I add OnAfterResponseProcess client side event to handle the printing scenario.Here’s the code:
function printWindow() { var printWin = window.open("./TempReports/EnableExportingPage.html"); if (printWin == null) { setTimeout(printWindow(), 500); } else { printWin.print(); printWin.close(); } } function WebGrid1_OnAfterResponseProcess(gridId, action, lastRequestObject, xmlResponseObject) { if (action == "Export") { printWindow(); } }
I attached the modify EnableExporting.aspx page as well. Please kindly add the page to the WebGrid Solution Samples, to see the result.Thank you.Regards,Hans K.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname