Click here to Skip to main content
15,938,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I hope you can help me / give me some hints

What I'm intending to do:
I'm implementing my own GUI-Designer and therefore I need a Table/Grid-Control.

To be more specific:
I want to implement a custom Table/Grid-Control, where I can add a user-defined amount of cells and columns. This Control is in a way comparable to the TableLayoutPanel, where every Cell includes a Label-Control. Every single cell should be clickable (in DesignMode) and have their own properties. In addition every single cell should be able to switch between simple Textfield, Radiobutton, Checkbox.

What I have done so far:
I have implemented my own control ("Table") which extends the TableLayoutPanel, where every Cell gets filled with a custom Label-Control. Furthermore I coded my own Designer (extends ParentControlDesigner) to get the Glyph-Functionality for Resizing Cells etc.

This works fine for very small Tables (e.g. 3x5), but the performace for large Tables (20x50) is really awful. I think the reason is, that the TableLayoutPanel is containing that much Labels. The VisualStudio internal Designer has the same (even slower) problems when creating a large TableLayoutPanel and fill every cell with a panel. It's nearly unusable when resizing the Control.

I have deactivated the refresh of my propertygrid already, but still too slow. In my opinion the performace-lack is due to the resize events of every single lable when Resizing the whole table.


Are there better approaches to my problem? Is there a better way to implement a simple but big table/grid where the user is able to modify the properties for each single cell at design time?

Thanks a lot in advance for any hints

1 solution

Plenty of table grids are available here. There's even a very popular one[^] by our esteemed leader.

My bad. Didn't realize it had to be in C#. Here's a C# one called SourceGrid[^]. There's probably others. Just use the CP filtering on the language you want.
Share this answer
akamper 18-Jan-11 8:02am    
Thank you for your answer. I have already found that, but this is a MFC Control and I need a WinForms Control. Obviously the TableLayoutPanel is far too slow for large Tables (as I have found out (google) that a lot of other people facing similar performance problems, but in none of these discussions I could find a solution for this problem)
Bassam Abdul-Baki 18-Jan-11 8:04am    
Did you look at SourceGrid? I updated my answer.
akamper 18-Jan-11 8:12am    
Thanks, not until now. I will have a look at it
thatraja 18-Jan-11 10:12am    
It's a great control(SourceGrid) BAB, 5!
akamper 19-Jan-11 5:12am    
I have tested the grid a little bit now. Its really great and powerful. Unfortunately there is no design time support implemented, which is a big need for my project (where I am trying to implement a small GUI designer).

I will have to try to add some basic design time functionality to the grid, so that the rows and columns get displayed in design time at least. Hope I can handle that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900