The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I''ve got a control which overrides the TreeViewAdv and recreates itself when certain events in my object model occur (representing changes in the tree).
However, I''m getting a lot of NullReferenceExceptions in TreeViewAdv during those events - for example calling SelectedNode excepts because SelectedNodes is null (and the get doesn''t check it before looking at the count). Also in BeginUpdate and Nodes.Add
Is there some method or something that puts the tree in a safe state or something that I''m missing?
Sue
ADAdministrator Syncfusion Team June 27, 2005 06:34 PM UTC
Hi Sue,
You might want to try calling BeginInit as follows, with a call to EndInit when you''re done.
((System.ComponentModel.ISupportInitialize)(this.treeViewAdv1)).BeginInit();
While I''m not familiar with the exact functionality of that call, I would think it ought to put the Tree in a safe state.
If that doesn''t work, please let me know and I''ll look into this further.
Regards,
Gregory Austin
Syncfusion Inc.
SHSue HarrisJune 27, 2005 10:27 PM UTC
Hi Gregory,
Unfortunately the Begin/EndInit calls didn''t make any difference. I would appreciate it if you could look into it further.
Thanks,
Sue
ADAdministrator Syncfusion Team June 28, 2005 08:09 PM UTC
Hi Sue,
I talked with the author of TreeViewAdv and he suggested SuspendLayout and/or LockWindowUpdate as possible solutions, depending on what you''re trying to do.
Do you have a sample that you could send me that demonstrates exactly what you''re trying to do so that I can step through it and tell exactly where it''s crashing?
Regards,
Gregory Austin
Syncfusion Inc.
SHSue HarrisJune 30, 2005 01:21 AM UTC
I figured out that the event was occuring after the control had been disposed -hence why there was so many NullReferences.
Thanks