Hello,
I have just update the infragistics version from 14.1.20141.2283 to 14.1.20141.2328 and a problem appeared.
In my case, I have a WHDG with one child band, and there is an <a> tag in the first column which is use to add a new child row by calling a javascript function. It works well in the original version, but in the later one, I am not able to add child row to a record that has no child band.
Here I found some reference that might be relevent:
http://dl.infragistics.com/community/aspnet/releasenotes/2014/12/14-1-20141-2328_ASPNET_RELEASE_NOTES.pdf
From the release note it state the following bug is fixed (page 5, 2nd item) --
"When a child band of the WebHierarchicalDataGrid have not items by defualt, even enabling the adding behavior will not allow to add new rows to that child band and the band will not have expand indicator"
It seems to be just the opposite of my case, I am facing a problem that was said to be solved. So how can I solve this?
Thanks in advance.
Regards,
KC
Thank you for posting in the Infragistics community !
In your original version, do you have a row in WebHierarchicalDataGrid with no child grid ? Does this row has an expand indicator ? Do you use BatchUpdating ? How exactly do you handle adding the child row ?
How this changed after upgrade ?
It would be very helpful to answer these so that I will be able to reproduce the exact behavior and suggest accordingly to solve your issue.
Looking forward to hearing from you.
Hi Hristo,
Thank you for your quick response.
Yes I have some records in the WebHierarchicalDataGrid with no child grid and in both version there are no expand indicator.
I am using BatchUpdating and use javascript to add new child rows. Here are some of my code:
EditingCore behaviors setting are as follow:
parent grid:
<igtbl:EditingCore BatchUpdating="true" AutoCRUD="false"></igtbl:EditingCore>
child band:
<igtbl:EditingCore BatchUpdating="true" AutoCRUD="false" EnableChildlessRowsPopulation="true"></igtbl:EditingCore>
And here is the js function:
function addNewChildRow(gridName) { var grid = $find(gridName); var gridBehaviors = grid.get_gridView().get_behaviors(); var parentRow = gridBehaviors.get_selection().get_selectedRows().getItem(0); if (parentRow == null) { parentRow = grid.get_behaviors().get_activation().get_activeCellResolved().get_row(); }
var childGrid = parentRow.get_rowIslands()[0]; var row = new Array(childGrid.get_columns().get_length()); for (var i = 0; i < row.length; i++) { row[i] = null; } childGrid.get_rows().add(row); parentRow.set_expanded(true);}
The bold line above doesn't work in the updated version. var childGrid is null here, the row island do not exist.
So how can I get the row island? Or maybe the right question should be how to create one?
I put together a sample with hierarchical data and used your code to add row, It worked fine in both versions 2283 and 2328.
Please note that when you run this sample the third row which has no child data is rendered WITH expand indicator and child row island is visible when you expand. However if the user adds new row in the root grid then expand indicator is not rendered and there will be no rowIsland for the freshly added row. If this is the case then there is another approach that can be followed to add row.
Please run my sample and observe it. If I have missed something in your scenario please feel free to modify the sample in order to reproduce your issue and send it back for investigation.
Hello Hristo,
Thank you for your reply. I have compared the sample you provided to my code and was able to figure out the problem.
I found that as I did not set EnableInheritance property of EditingCore, I should set the EnableChildlessRowsPopulation property to the EditingCore in the child band instead of the parent grid. After I have made such change, the problem is solved.
However, I wonder why it works in the original version. I am suspecting that the default value of EnableInheritance has changed between the two versions. Am I right?
Looking forward to your reply.
I think I am not going to set up the environment for an old version again for testing that issue. Just want to see if there is a theoretical answer. It doesn't matter if there isn't. I will take it as a fact that now the property EnableChildlessRowsPopulation should appeared in the behaviors of the child band, either by inheritance or by setting it explicitly.
Anyway, thanks for your help.
I believe the EnableInheritance is false by default in both versions. Also my sample worked fine in both as I tested it. However please feel welcomed to modify my sample in order to reproduce your issue and I will investigate it for you.
P.S. I am glad this helped you resolve your issue.
Please let me know if any other questions occur.