473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

treeview multiselect problem

hi,

i am a new to c#, i hav 4months experience in C#,
I am populating a treeview in c# from XmlFile, and i have implemented
a multiselection in that treeview by overriding treeview select
events when ctrl or shift is pressed, which was written a seperate
DLL, and added with my project,
now i hav a problem that when i select treeview nodes by pressing
shift key at a same time initially it is creating an exception
"Object
reference not set to an instance of an object" and the application
closes.
i know this is bcoz, i have enqued selected nodes to a arraylist.
once
it presses shift its starting enqueing, and at that time selected
node
is null, thats y it is generating this exception i guess,
can anybody tell me how could i solve this?
Jun 27 '08 #1
2 1875
On Apr 21, 4:25 pm, Selva Kumari Padmanabhan <selvakumar...@gmail.com>
wrote:
hi,

i am a new to c#, i hav 4months experience in C#,
I am populating a treeview in c# from XmlFile, and i have implemented
a multiselection in that treeview by overriding treeview select
events when ctrl or shift is pressed, which was written a seperate
DLL, and added with my project,

now i hav a problem that when i select treeview nodes by pressing
shift key at a same time initially it is creating an exception
"Object
reference not set to an instance of an object" and the application
closes.

i know this is bcoz, i have enqued selected nodes to a arraylist.
once
it presses shift its starting enqueing, and at that time selected
node
is null, thats y it is generating this exception i guess,

can anybody tell me how could i solve this?
maybe you just need add null check to the selected nodes, if it is
null, then do not enque it.
Jun 27 '08 #2
On Apr 22, 12:31*pm, fyitang <fyit...@gmail.comwrote:
On Apr 21, 4:25 pm, Selva Kumari Padmanabhan <selvakumar...@gmail.com>
wrote:


hi,
i am a new to c#, i hav 4months experience in C#,
I am populating a treeview in c# from XmlFile, and i have implemented
a multiselection in that treeview by overriding *treeview select
events when ctrl or shift is pressed, which was written a seperate
DLL, and added with my project,
now i hav a problem that when i select treeview nodes by pressing
shift key at a same time initially it is creating an exception
"Object
reference not set to an instance of an object" and the application
closes.
i know this is bcoz, i have enqued selected nodes to a arraylist.
once
it presses shift its starting enqueing, and at that time selected
node
is null, thats y it is generating this exception i guess,
can anybody tell me how could i solve this?

maybe you just need add null check to the selected nodes, if it is
null, then do not enque it.- Hide quoted text -

- Show quoted text -
yes that is a problem i have cleared that
anyway thanks for ur reply...
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tod4 | last post by:
Hi, My problem: I have query with value klient and product. On my form Im using multiselect box as filter of klient value. Now I would like to use second multiselect on this form for product...
2
by: themoosman | last post by:
Does the tree view in VS 2005, have mutli select capability? If not does anyone know of any alternatives.
0
by: larry mckay | last post by:
does anyone know how to make a treeview control have a multiselect option? does anyone have any code that already does this? *** Sent via Developersdex http://www.developersdex.com ***...
4
by: dev | last post by:
Can we select multiple nodes in a visual studio 2005/.NET 2.0 treeview using CTRL/Shift or do we have to write all that code like in .NET 1.x? Thanks in advance. Bill
3
by: kaosyeti via AccessMonster.com | last post by:
hey... i have an unbound multiselect listbox on a form that i want to use to populate text boxes on that form. so if a user selects the 3rd item in a list of 20, how can i have that item show up...
2
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, Is it possilbe to multiselect nodes in a treeview control and drag and drop them
18
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, Is there a way for TreeView to have multiple selections? But I am not talking about its checked boxes. I want a way similar to ListView with MultiSelect = True. So I can use or key and...
0
by: selvakumari | last post by:
I am populating a treeview in c# from XmlFile, and i have implemented a multiselection in that treeview by overriding treeview select events when ctrl or shift is pressed, which was written a...
0
by: Selva Kumari Padmanabhan | last post by:
hi, i am a new to c#, i hav 4months experience in C#, I am populating a treeview in c# from XmlFile, and i have implemented a multiselection in that treeview by overriding treeview select...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.