Treeview bug : Select top visible item but itself?

S

Saul

Hi all,

I am struggling with an annoying problem. It's a little difficult to
describe, but I will try as simply as I can.

The issue is with a Treeview control, which has a two level structure, in my
cases, category and product. This issue is only visible when the tree is
expanded so that a vertical scroll bar is displayed, and the topmost visible
item is a product. I will try to draw this in text..

(top of treeview)
-Category 1
Product 1
Product 2
------------ (top of visible in screen)
Product 3 << Selects this when you expand/contract Category 2 (or 3)
Product 4
+Category 2
+Category 3
... etc
------------ (bottom of visible in screen)

Note that Category 1 is exanded (off screen), but Category 2 (on screen), is
not. Also note that the Tree.SelectedNode has been set to Nothing in code.
Now, the bug happens when you expand Category 2. When you do this, it does
expands category 2 correctly, but then SELECTS Product 3! It also does this
when you contract Category 2 as well.

My theory is that a treeview likes having something selected. When the
category is exanded, it seems to re-select the screens topmost visible item.
This is strange to me, at the very least I would expect it to select the
thing you were expanding/contacting? I set the selection back to nothing so
that you can easily re-select the same product.

Has anyone else hit this problem? Found a work around?

Any and all help appreciated!!

Regards,
Saul

ps. If I have not explained this situation well, please ask for any
clarification.
 
S

Saul

Tom,

When I get back to work on Monday, I may just take you up on this. It is
surprisingly important for the final roll out of our application - to over
300 people.

- Saul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top