Solved

C# WinForms Development

Posted on 2004-10-08
1
249 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
network + 7 73
External app config and encryption of settings 1 49
Problem with SqlConnection 5 109
String manipulation 15 49
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

771 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

11 Experts available now in Live!

Get 1:1 Help Now