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
We are using the latest version of the Intersoft WebGrid. We have a self-referencing hierarchical grid that has RowChecker enabled so there is a "check all" check box in the column header of the checkbox column that when checked will check all of the rows in the grid. The issue is that this is a hierarchical grid and so at any time, one folder may be expanded showing the child rows but all the other parent rows are collapsed (so their child rows are not visible). When the RowChecker "check all" checkbox in the column header is selected, all the rows are checked, even those that are collapsed and so are not visible. Is there a way to tell the RowChecker to only check the child rows that are visible and to not check the child rows that are in a collapsed state and so are not visible?
Hello,Thank you for waiting.I found a work around that perhaps you could use.I add a couple of validation codes in OnCheckBoxClick client side event. The code checked whether the child row is expanded or not. The WebGrid will uncheck the checkbox, if the row isn’t expanded.Here’s the example snippet code in OnCheckBoxClick:
function WebGrid1_OnCheckBoxClick(controlId, tblName, colName, checkboxValue, originalCheckBoxValue) { var WebGrid1 = ISGetObject(controlId); var tableWebGrid1 = WebGrid1.Tables[tblName]; var tableRowObject = tableWebGrid1.ToRowObject(WebGrid1.CheckedRowContext); if (!tableRowObject.ChildExpanded) { tableRowObject.Uncheck(); } }
I also attached the sample about how I implement the code (based on Hierarchical.aspx WebGrid Sample). To run the sample, just simply add the sample to the WebGrid Solution Sample.Please kindly have review on the sample and let me know your response.Regards,Hans.
Hi,
Thanks for this, getting close however I think this results in an endless loop as the checkbox checked event is unchecking checkboxes which in turn calls the checkbox checked event which unchecks checkboxes....etc..
What might solve it is if we can test if the checkbox is checked before we uncheck it....this way once the function unchecks a box, it will never touch that box again.
Something like this:
if (row.IsChecked() && !row.ChildExpanded) {
Just not sure about the IsChecked() piece..is that valid? Should I use Checked? Or something else?
Also, now that we have the latest version of the WebGrid, I can no longer find the API documentation. You used to distirbute the client-side and server-side API docs...where are those now? They are essential for doing development with your tools.
Also tried this:
if (r.Checked && !r.Visible) {
r.Uncheck();
}
however, even if a row (r) is collapsed and so is not visible, it's Visible property still returns True....so this does not work. Is there a way to tell if a leaf row is collapsed or expanded and also if a row has a parent?
Hello,Thank you for your reply.In my local end, the result is not an endless loop, but it takes more time to WebGrid to finish the checking process, indeed.Perhaps you should use: “Checked” attribute to validate whether the row is already checked or not. Because there is no IsChecked() method in row object.You could see / get the WebGrid’s documentation from your local environment, “Start Menu -> All Programs -> Intersoft Premier Studio 2013 R1 -> WebUI Studio for ASP.NET -> WebGrid 8 -> WebGrid 8 Documentation”.You also could get / download the WebGrid’s documentation from this link below:-http://intersoftpt.com/Support/WebGrid/Documentation/-http://intersoftpt.com/Support/WebGrid/WebGrid.chmTo know whether the child row is collapse or expanded, you could use “ChildExpanded” attribute.The “ChildExpanded” attribute will have False if the child row is collapse and vice versa.You could use GetParentRow() method to validate whether the row has a parent or not.Here’s the example snippet code how-to use the GetParentRow() method:
function WebGrid1_OnRowSelect(controlId, tblName, rowIdx, rowElm) { var WebGrid1 = ISGetObject(controlId); var parentRow = WebGrid1.GetSelectedObject().GetRowObject().GetParentRow(); if (parentRow) { alert("This row have parent row "); } else { alert("This row doesn't have parent row "); } return true; }
I use the GetParentRow() method in OnRowSelect client side event.Hope this helps.Regards,Hans.
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