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
I have an unbound hierarchic grid where the user can expand and collapse the top level rows, and I need to be able to rebuild it on postback with the same rows expanded. I tried using the Expand property of rows before the postback, but it is never set true. I also tried handling the OnGroupExpand event, but this does not seem to fire.
To demonstrate these problems, I've added to the Hierarchical_Unbound_Programmatic tutorial. On the apsx, I added
<script type="text/javascript"> function OnClientCellDblClick(id,args) { var grid = ISGetObject(id); var rt = grid.RootTable; var rc = rt.GetRowsCount(); var noneExpanded = true; for (i = 0; i < rc; i++) { var r = rt.GetRow(i); if (r.Expanded) { alert('Row ' + i + ' is expanded'); noneExpanded = false; } } if (noneExpanded) alert('No rows are expanded'); } function OnClientGroupExpand(id) { alert('group expanded'); } </script>
and in the code behind, I added to the Page_Load method
grid.LayoutSettings.ClientSideEvents.OnCellDblClick = "OnClientCellDblClick"; grid.LayoutSettings.ClientSideEvents.OnGroupExpand = "OnClientGroupExpand";
If you run the page and expand a line, the OnGroupExpand does not fire. If you then double click on any cell, the OnClientCellDblClick function will not find any rows expanded.
Hello Robert,
To get a rows that expanded by user, I think you get little bit missing. you should use ChildExpanded. You can try this code :
<script type="text/javascript"> function OnClientCellDblClick(id, args) { var grid = ISGetObject(id); var rt = grid.RootTable; var rc = rt.GetRowsCount(); var noneExpanded = true; for (i = 0; i < rc; i++) { var r = rt.GetRow(i); if (r.ChildExpanded == true) { alert('Row ' + i + ' is expanded'); noneExpanded = false; } } if (noneExpanded==true) alert('No rows are expanded'); } function OnClientGroupExpand(id) { alert('group expanded'); }
Would you like to tell me that I am right or not ?
Hope this helps.
Riendy
You're right, Riendy, it's the ChildExpanded property that I need - it works fine. The help could be clearer about this; as I understand "expanded", child rows are shown when the parent is expanded and not when the parent is collapsed. So for the Expanded property "Gets or sets a value that indicates whether the row is expanded" should read "... whether the row's parent is expanded". The ChildExpanded text is "Determines whether the Child Rows of current row is expanded" should read "... whether this row is expanded".
Anyway, thanks for your help.
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