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

Reflection, TabPages and ListViews

I'm stumped.

I load add-ins at run time. Each Add-In has a collection of
UserControls. These UserControls are then added to a TabControl as
TabPages. The UserControls are created in the Add-In's ctor.

Here's the code that loads the Tab Control when the add-in is selected
from a List;

private void LoadTabPages(string AddInName)
{
tabControl1.TabPages.Clear();

//addIns is a Dictionary<string, IAddIn>
IAddIn addIn = addIns[AddInName];
if(addIn == null)
return;

foreach (UserControl ctr in parser.TabForms)
{
TabPage t = new TabPage(addIn.Tag.ToString());
ctr.Dock = DockStyle.Fill;

tabControl1.TabPages.Add(t);
t.Controls.Add(addIn);
}
}
It works fine, except that I cannot get the Add-In to update its own
listview after it's already been selected from the List.

Example of when it works
1. Start App
2. Run process that adds to the Add-In's ListView
3. Select that Add-In from a list
4. The Addin's UserControl (with ListView) is added to a TabControl as
a TabPage
5. All the data is present in the ListView

Example of when it does not
1. Start App
2. Select that Add-In from a list
3. The Addin's UserControl (with ListView) is added to a TabControl as
a TabPage
4. Run process that adds to the Add-In's ListView
5. No Data is shown in the ListView

But the stickler is, when I step through the code, the ListView clearly
shows Items present, they are just not being displayed. >:|

I've tried using
PerformLayout();
ResumeLayout();
Invalidate();
Refresh();
etc, but nothing works.

Please Help.
I'll gladly post more code if needed.

Jun 1 '06 #1
0 1242

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gary Morris | last post by:
Hello all, This is my situation. I'm reading an XML file with a variable number of nodes. So far, all of the code has been reasonably easy, but now I'm up against a wall trying to figure out...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
8
by: rowe_newsgroups | last post by:
I know this has to be answered in the archives somewhere, but the search results are just confusing me more :-( Anyways, I authored a control library that contains an Interface definition and...
17
by: raylopez99 | last post by:
What good is C# Reflection, other than to find out what types are in an assembly? And to dynamically invoke methods in an assembly (.dll or .exe)? Also, bonus question, can you use Reflection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.