How to remove node?

Hi,

What is the correct way to delete a node?

I tried with node.remove or tv.selectednode.parent.nodes.remove(node). they worked but the structure is broken.

My image

The node position and other columns is indented one level to the right (nodes position are changed)

The icons now overlay node names.

.

Thanks you!


6 Replies 1 reply marked as answer

SG Santhosh Govindasamy Syncfusion Team September 2, 2024 12:45 PM UTC

Hi jamin,

Thank you for reaching out.


The methods you mentioned for removing a node—using node.Remove() or tv.SelectedNode.Parent.Nodes.Remove(node)—are correct.


However, based on the information and image reference you provided, it seems like the node removal is affecting the structure, causing nodes to become indented incorrectly, and icons to overlay the node names.


We tried to replicate this issue on our end by creating a simple sample and removing nodes in the same way. In our tests, the nodes were removed correctly, the structure remained intact, and the icons were updated properly without overlapping the node names.


For your reference, we have attached a simple sample. Please take a look at it.


To assist you further, could you please confirm if the issue occurs specifically when removing nodes at runtime, where the icons overlay the node names? Additionally, could you provide more details on the actions performed that led to the nodes’ positions changing? Knowing the product version you’re using would also be helpful.


We appreciate your cooperation and look forward to your response.

Regards,
Santhosh.G


Attachment: MultiColumnTreeView_Demo4_8_90272e84.zip


JA jamin September 3, 2024 08:31 PM UTC

Hi Santhosh

please set: mtv.hscroll=false;

then try to delete selected node, then you can get this.



SG Santhosh Govindasamy Syncfusion Team September 4, 2024 12:16 PM UTC

Hi jamin,

Thanks for your response.

We have checked the reported issue " Node text overlaps the image icon after nodes are removed at runtime when horizontal scrollbar is disabled" on our end and it is confirmed as a defect. And We have logged a bug. We will fix this issue and include it in our NuGet release Which is scheduled on October 01, 2024.

You can track the status of this report through the following feedback link,


Feedback link-> https://www.syncfusion.com/feedback/60987/the-node-text-overlaps-the-image-icon-when-nodes-are-removed-at-runtime


Note: The provided feedback link is private, and you need to login to view this feedback.


We appreciate your patience until then.


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”

Regards,
Santhosh.G



JA jamin September 4, 2024 08:52 PM UTC

Pretty long Santhosh,

anyway I hope to get it fixed before I get a related bug and have to wait another month..

If this is related to treeviewadv, please check that too as it seems these 2 controls are related.



SG Santhosh Govindasamy Syncfusion Team September 5, 2024 10:48 AM UTC

Hi jamin,

Thank you for your feedback. We understand your concerns and will make sure to address this issue in TreeViewAdv as well. We’re actively working on this and will notify you as soon as the fix is released. We appreciate your patience and understanding in the meantime.


Regards,
Santhosh.G



SG Santhosh Govindasamy Syncfusion Team September 30, 2024 02:23 PM UTC

Hi jamin,

We would like to let you know that Essential Studio Weekly NuGet packages (V27.1.51) has been published in nuget.org with the fix for the issue “Node text overlaps the image icon after nodes are removed at runtime when horizontal scrollbar is disabled”. Please let us know if you have any concerns in this.


Root cause:

Based on our implementation, when we remove nodes at runtime, the HScroll property is updated. However, in this scenario, the HorizontalScrollbar value was not updated correctly, which led to the reported issue. We have now updated the HorizontalScrollbar value based on HScroll property.

Regards,
Santhosh.G


Marked as answer
Loader.
Up arrow icon