Solved

C# WinForms Development

Posted on 2004-10-08
1
250 Views
Last Modified: 2012-06-27
My question is best given by giving an example. Lets say I developed a form called Form1 which has 2 panes called LeftPane and RightPane.  Contained on LeftPane are 2 labels, named Label1,Label2.  If I click on Label1, I want to change the contents on RightPane.  If I click on Label2 I also want to change the contents on RightPane.

This is kind of like using MS outlook where you click on inbox and the right pane shows your email.  If you click on your address book the right pane shows your contacts.

I just want to be sure that I do this correctly.  I had thought that I could make 2 more panes, contained inside of RightPane and when someone clicks on Label1, or Label2, I would just make the panes visiibility true or false.  But I am wondering if this is a good idea as I will be initially loading all the panes. (I feel that this is probably the hack way around this.)  So if anyone knows how to do this properly I would great appreciate the info.

Thanks!
0
Comment
Question by:sbreen
1 Comment
 
LVL 9

Accepted Solution

by:
msdixon earned 500 total points
ID: 12262761
you're going to take a performance hit, it just depends on when you want it.

if you load it all up front, the initial load will take longer, but hiding and showing data will be speedy.

if you load it on demand, the page will load quickly, but every time the user clicks on an item, they have to wait for it to load.

here's what i've done:

1. load the absolutely necessary information initially.
   (i set the cursor to Cursors.WaitCursor, and have the status bar let the user know the data is loading "Loading Data..." or somethign like that)
2. at the end of the load method (or init, or the contstructor -- wherever you're loading the data initially), i reset the cursor and status bar.
3. in a new thread i load the rest of the data. for instance i have master / detail grids. i fill all the details in the dataset for all of the master records. then, when they click on a master record, i filter the detail grid.

filter uses sql like statements. i.e. "[columnName] = 'value'"
grid.DataSource = new DataView(ds.Table[0], filter, "", DataViewRowState.CurrentRows);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
what technologies offer Authentication over Web Services? 4 105
Need to pass stored proc parameters in list 13 33
C# parent child form 5 19
Code works but it's slow 24 44
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now