Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Treeview Datawindow Oddity (FYI)

Treeview Datawindow Oddity (FYI)

Treeview Datawindow Oddity (FYI)


I thought I would give a shot at contributing something here. I found a strange behavior in the treeview datawindow I would like to share.

I have a treeview datawindow with four levels. If three levels are exposed, but third level is not expanded to show the items in the fourth level, I found I could click in the very middle of the space between two items on level three and, after that, the level three item would not be selected but, if I expanded level three exposing level four, I would find one of the items on level four selected.

To get around this, I put the following code in the treenodeselecting event. If an item from level four is selected but level three is is not expanded (level four items are not exposed), the selection terminates.

If grouplevel = 4 And Not isExpanded (row, 3) Then
// return code other than 0 cancels selection operation...
Return -1
End If

It is simple, but effective.


RE: Treeview Datawindow Oddity (FYI)

A bit more genericized:

// only check if grouplevel > 1
If grouplevel > 1 Then
If Not isExpanded (row, grouplevel - 1) Then
// return code other than 0 cancels selection operation...
Return -1
End If
End If

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close