473,434 Members | 1,649 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,434 software developers and data experts.

Nested Display

mshmyob
904 Expert 512MB
I am in testing mode for this part of my app so I can change anything to make this work.

I have added email functionality to one of my apps. I use SMTP to send and either POP3 or IMAP4 to receive. For the receive I store everything into tables except attachments - they are in a directory and only referenced in the tables.

Everything works fine so no problem getting email to work.

What I am wanting has to do with the interface. Everthing for viewing an email account and emails looks good and works. One of the tables I have has 'folder' names called 'Inbox, outbox, trash, etc.' - the standard 'folders' in an email app. Clicking (from a list box control) on any of those shows the emails in the appropriate 'folders'

What I want now is to allow an end user to add their own 'folders' - Such as Clients. I can do that but now I want 'sub folders'. Such as under Clients they may have a Jane Doe 'folder', a Joe Blow 'folder', etc.

That is the part I am having trouble with. How can I set up the table to accomodate that and more importantly how can I display it in a nested fashion.

I was fooling with a table like so:

tblMailUserFolders

MailUserFolderID - autonumber
MailUserFolderName - text
MailUserParentFolderID - number (long)

The MailUserParentFolderID would reference back to the MailUserFolderID

example

Record 1

MailUserFolderID = 1
MailUserFolderName = Clients
Mail UserParentFolderID = NULL - NULL would indicated root folder

Record 2

MailUserFolderID=2
MailUserFolderName = Jane Doe
MailUserParentIDFolderID = 1 - any value here other than NULL would indicated a nested folder

I have no problem getting the data in but cannot figure out how to display it in a nested view.

Remember this is in testing mode and I can make any changes. The only requirement I have is that tables are used and NOT real directories.

Any ideas?

cheers
Mar 28 '09 #1
25 3483
ADezii
8,834 Expert 8TB
@mshmyob
To graphically display data in a Nested/Hierarchal view, such as would exist in a Relational Database, I use a TreeView Control. Have you considered this Option?
Mar 28 '09 #2
mshmyob
904 Expert 512MB
Thanks ADezii,

I have never used the Treeview Control before. I will research that and give it a try.

cheers,

@ADezii
Mar 29 '09 #3
ADezii
8,834 Expert 8TB
@mshmyob
This Control can be tricky to use, as soon as I get a chance, I'll whip up a Demo for you to Preview. Actually, I'll Attach a Demo that I use right now:
Mar 29 '09 #4
FishVal
2,653 Expert 2GB
Just subscribing.
I will post some demo later when get a time to cleanup and comment the code.
Mar 30 '09 #5
mshmyob
904 Expert 512MB
Thanks AD,

I am working on it and will let you know. But I believe you are correct (as usual) that the ListView is the way to proceed.

cheers,

@ADezii
Mar 30 '09 #6
mshmyob
904 Expert 512MB
Thanks Fish,

Look forward to it.

cheers

@FishVal
Mar 30 '09 #7
ADezii
8,834 Expert 8TB
@mshmyob
mshmyob, just keep in mind that the ListView and TreeView are two, distinct, Controls and do not refer to the same thing.
Mar 31 '09 #8
mshmyob
904 Expert 512MB
Sorry AD, I meant TreeView :).

cheers,

@ADezii
Mar 31 '09 #9
FishVal
2,653 Expert 2GB
Well.

Frankly speaking, I've written this sample a while ago and the code was very kludgy and uncompleted. It was not tested in long run (I use tree with other relationship type in my applications) and a part of code was written from scratch today. It seems to work, but I couldn't state it has completely no bugs.

Contents:

Tables:
[tblTree] - tree source
the rest tables with meaningful names are used to store values to initialize object properties (in the sample only one object of OtMTree class).

Queries:
all the queries are used to initialize object properties

Forms:
[frmDObjects] - edit values used to initialize object properties
[frmTree] - form with sample tree

Modules:
[DObj] - routine to initialize object properties
[SQLSelect] - simple SQL statement parser class
[OtMTree] - class which handles all operations with tree (One-to-Many Tree)

Sample tree has the following properties:
  • WYSIWYG editing of node text
  • WYSIWYG adding of new node
  • WYSIWYG deleting of node (button in the left upper corner). So far it treats orphans appearing after node with children has been deleted in only one way - make them children of parent node.
  • Drag-and-Drop to move node
  • Tree nodes expanded/colapsed state as well as node order persists in source table
  • Nodes have icons which are being rendered from ImageList control. Icon keys are stored in source table.
Attached Files
File Type: zip Tree.zip (79.3 KB, 240 views)
Mar 31 '09 #10
mshmyob
904 Expert 512MB
Thank you AD and Fish.

I will study your code and see what I come up with in during the next week or two and let you know my results.

Again thank you.

cheers,
Apr 1 '09 #11
ADezii
8,834 Expert 8TB
@mshmyob
If you are interested, I can provide you with the Help Files for the Microsoft Common Controls, which includes, but is not limited to, the TreeView Control. It is extremely handy, in that it will provide comprehensive Help for the Properties, Methods, and Events that the Control exposes. Just let me know if you are interested.
Apr 1 '09 #12
mshmyob
904 Expert 512MB
Thanks AD,

That would be EXTREMELY helpful.

cheers,

@ADezii
Apr 1 '09 #13
ADezii
8,834 Expert 8TB
@mshmyob
Hello mshmyob, I think that you will find this very helpful, not just for the TreeView Control, but the others also. Enjoy!
Apr 1 '09 #14
FishVal
2,653 Expert 2GB
For those who find it interesting I'm attaching the last version of tree interface sample. There are several major enhancements in comparison with the previous version.
  • Two shortcut menus were added to OtMTree class and now all operations with nodes and tree are being held via these menus.
  • Node properties dialog was added.
  • Tree search dialog was added.

Regards,
Fish.
Attached Files
File Type: zip Tree2.zip (116.5 KB, 210 views)
Apr 4 '09 #15
mshmyob
904 Expert 512MB
Thanks Fish,

I just completed my first run to get an understanding of the treeview using AD's code and help file. I am now ready to advance my understanding by looking at your code.

This will come in very handy.

Just to let you know I am now working with 3 tables.

tblMailAccount - holds email account info
tblMailFolder - holds folder info - linked to tblMailAccount & tblMailMessage
tblMailMessage - holds all info related to email messages

Obviously my root is picked up from the tblMailAccount and my child nodes are picked up from the tblMailFolder and the details of the selected node are picked up from the tblMailMessage.

cheers,

@FishVal
Apr 4 '09 #16
NeoPa
32,556 Expert Mod 16PB
@mshmyob
I want to follow this thread but have little to add, particularly to the Tree structure discussion.

I would recommend using the ASMTP protocol though. In the current environment there are likely to be more and more situations where restrictions are placed on SMTP traffic at a network and security level. Authenticated SMTP will make it easier to get around such restrictions if/when you come up against them. It will also make you more popular with any network administrator trying to restrict email borne malware etc. Just an idea.

Good luck with your project :)
Apr 4 '09 #17
mshmyob
904 Expert 512MB
Good point Neo,

The ActiveX client I am using supports ESMTP so I will create functions for both SMTP and ESMTP.

cheers,

@NeoPa
Apr 4 '09 #18
NeoPa
32,556 Expert Mod 16PB
Does the ESMTP API support the ASMTP protocol?
Apr 4 '09 #19
mshmyob
904 Expert 512MB
I can support ESMTP, Plain, Login, CRAM-MD5, NTLM, MSN authentication.

My understanding of ASMTP is just authorizing your SMTP connection to prevent spammers from gaining access to the outgoing mail server on your ISP or internal mail server.

cheers,

@NeoPa
Apr 4 '09 #20
NeoPa
32,556 Expert Mod 16PB
Mine too. I don't know, but I suspect the API would have to support passing the credentials to the ASMTP server?
Apr 4 '09 #21
ADezii
8,834 Expert 8TB
@mshmyob
I use code frequently that routes E-Mails directly through a SMPT Server, and have never had a problem yet. If you are interested, let me know and I'll post the relevant code and/or a Demo.
Apr 4 '09 #22
NeoPa
32,556 Expert Mod 16PB
@ADezii
That will either be because the SMTP provider hasn't put the proper security in place, or it is at a network level.

With the prevalence of compromised PCs around which have there own SMTP service set up in malware it's not responsible for network administrators to allow SMTP traffic from all PCs to pass through either their SMTP servers or their firewalls.

Many do (ISPs have very little choice, although some are preparing to switch to ASMTP already), but there are relatively few who appreciate the problem and the solutions available. I wouldn't ever recommend designing software that relies on such low levels of security though. Customers can be many and varied, and the more there are, the less chance there is that none of them will be required to work in a properly secured environment.

Preparing a proper solution is not so hard and protects you from unhappy customers down the line.
Apr 4 '09 #23
ADezii
8,834 Expert 8TB
@NeoPa
I should have been a little more specific in my explanation, NeoPa. Only a select, few, supervisory PCs are allowed to directly route through the SMTP Server via acceptable IP Addresses. On top of this, there is a specific Front End, available to only a select number of individuals who will actually be able to utilize this functionality.
Apr 5 '09 #24
mshmyob
904 Expert 512MB
Thanks for the offer AD but I have no problem with SMTP. Authenticating is also no problem for me.

Strange that I can create the entire emial system no problem but the TreeView is the hardest part :) but now I have a grasp of it so now with the final touches of Fish's code I think it will be just what I envisioned it to be. Only one part left of it but I will start a new thread if I have a problem with the last part.

cheers,

@ADezii
Apr 5 '09 #25
NeoPa
32,556 Expert Mod 16PB
That's good to hear Mshmyob.

If I may though, at the risk of weighing down this topic with too much security detail, respond to ADezii's last post, as I feel it is important to clarify this for anyone reading it who may not have the experience it seems clear we all have.

Your (ADezii's) network sounds like it's well set up and the security has been considered. This illustrates well the need for considering the security issue in the code as suggested. Consider the code running within your network but from a PC that is not allowed to send SMTP through the server. Not easy for support, when a user calls up that will probably not be aware of the IP security that's in place. I know this as I've had very similar problems in my network where PCs were blocked and I'd forgotten all the details of exactly what was set and where. That was as the administrator. Imagine how a user of the software may be confused.

Anyway, I'm glad this security discussion has been aired as it's something many are not aware of.
Apr 5 '09 #26

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Glen | last post by:
I have a Struts action form which contains a bean. I am trying to display a bean retrieved from the database in this form using the nested tag. Can anyone help me? I continue to get an error...
5
by: horndude77 | last post by:
Ok, this might be for a web designing group, but here's my problem. I'm trying to make a web page with tabs which you can navigate between without the page reloading. I have one set of tabs working...
2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child...
20
by: Robert | last post by:
Need some help to stop me going around in circles on this one.... Have a nested subform (subform2) which simulates a continuous form for the record on the parent subform. Subform2 has rows of...
0
by: Stefan L | last post by:
Hi everybody! I was just starting to use partial classes in my projects, but it is kind of anoying that the VS solution explorer displays the files flat in the hierachy rather than nested. ...
5
by: ZikO | last post by:
Hi there. I have a problem. I have created nested classes but don't know how to access to inner classes. I know I can create objects: Hen Object; Hen::Nest ObjectNest; Hen::Nest::Egg...
2
by: brad | last post by:
Group, I'm using Visual Studio 2003 to create an ASP.NET 1.1 project which contains nested server user controls in order to create a tree-like hierarchy. The tree is a sort of question and...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
4
by: dagabe14 | last post by:
Hi, this is my first time posting here, so be please be nice. If i do something incorrectly (and admin notices), please let me know of my mistake. So, I am attempting to make nested tables that...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.