Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2004

Tip: Looking for answers? Try searching our database.

Treeview and Listview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Albert - 12 Aug 2004 09:31 GMT
Hi,

I'm building a "Server management console" in which the administrator can
see which users (clients) are logged-in and which actions they are taking.
Now my problem is the following;
For the logging of different info, i use datatables (e.g. a table for
"clients" one for "files open" one for "records locked" etc). When one of
the clients does something ( like logging-off, signing-in, opening a file..)
I alter the datatable (e.g datatable.row.delete). All these happenings get
processed ok, datatables are filled/altered correctly. My problem is in the
refreshing of the treeview/listview.
On top of the console i have some buttons, if you press one, i fill the
treeview with the data of one of the datatables, and depending on what node
is selected, I fill the listview in the same manner.
Ok imagine the following situation;
on the left the trieview with 2 users logged in, both with 2 files open.
Treeview shows "users"(parentnode) and "user1"& "user2" as two subnodes. I
select user2, listview shows two lines which shows info about the files
opened by user2. in the listview I select the second line.
I have a timer running which checkes every second which tree-/listview is
open (to know which datatables are used) and accordingly if any changes have
been made to the datatables that are displayed. All works like a
charm....When the management console has the focus.. and this is where my
problem sets in. I want the console to refresh also when it doesn't have the
focus. But i can't figure out how.
1.How do I know which nodes are selected
2.How do I "rebuild" the tree-/listview on the background (I rebuild like
this, which works fine with focus, tv.beginupdate, tv.clear,
tv.nodes.add....etc, tv.endupdate)

Hope someone can shed me some light on this issue.
If, after reading this, you think there is a better way of achieving what
i'm trying to achieve, pls let me know.

Thanks,

Albert R.
Software Engineer,

The Netherlands
Shell - 12 Aug 2004 09:46 GMT
Albert,

I have a question: why is your timer not working when your form doesn't
have focus? In my opinion, it should keep working fine. Are you getting
some sort of exception? Can you shed some more light on your
implementation? Perhaps you could post some sample code. Are you
building a MMC plugin, or is this a pure C# WinForms application?
Albert - 12 Aug 2004 10:58 GMT
I'm using VB.Net, it is a windows form handled by an application context.
The application starts when the server does. You will only see an icon in
the systray. When double-clicking this icon you will see the form.
The timer is working ok, don't have any problems with that.
Been looking into it a little bit more closely and I know how i can get it
to work if you can tell me how members of the tree-/listview can be kept
"selected" after the form loses focus. Take windows-explorer for example.
When you select a directory on the left, it'll become blue, when it loses
focus, it isn't blue anymore, but you can see it is still selected. This is
what im looking for.
The tree-/listview wasn't refreshing because the refresh trigger also uses
the node which is selected. (and none are selected when not focussed)

Albert

> Albert,
>
[quoted text clipped - 3 lines]
> implementation? Perhaps you could post some sample code. Are you
> building a MMC plugin, or is this a pure C# WinForms application?
Shell - 12 Aug 2004 12:10 GMT
Albert,

You could try changing the HideSelection property of the ListView and
TreeView to false. This will ensure that the selection remains selected
even when the control loses focus.

Hope that fixes it!
Albert - 12 Aug 2004 12:27 GMT
Thanks,
should have known it would be some kind of property. Sometimes when you're
looking at smt so long, you loose sight of the obvious.

> Albert,
>
[quoted text clipped - 3 lines]
>
> Hope that fixes it!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.