Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,
codeproject team,

I want to freeze rows in tablelayoutpanel, so that they can not be invisible while scrolling.
because that rows are used as headers while scrolling they goes upward so user can't see titles.

please help.
thanks & regards
Posted
Updated 23-Oct-18 17:00pm
v3

Not supported. TableLayoutPanel is not a control of it's own. It's an extension added to other controls. It has no rendering capability of it's own. It mearly tells other controls how to position and size themselves.

In order to pull off what you want, you'd have to have two, or more, layout controls inside of each other.

For example, the first TLP would have two rows, the first being your header row and the second being your detail.

Then a second TLP would go inside the first row of the top-level TLP. This will probably have one row and a bunch of columns containing your header controls.

Lastly, the third TLP will be in the second row of the top-level TLP and contain as many rows and columns as required to layout your data details.
 
Share this answer
 
Comments
Aarti Meswania 9-Aug-12 13:46pm    
thank you so much :)
you are right I have search on google also.
I have to design panel like solution 2's view
Volynsky Alex 9-Aug-12 17:22pm    
good answer
It will also useful to others who have same problem like this.
               TableLayoutPanel---cell(colId,RowId)

                  __________________________
                 |  |      cell(1,0)      <-+--colTblLayoutPnl
                 |__|_______________________|  (AutoScroll=False)
                 |  |                       |
       cell(0,1) |  |      cell(1,1)      <-+--DetailTblLayoutPnl
RowTblLayoutPnl--+> |                       |  (AutoScroll=True)
                 |  |                       |
                 |__|_______________________|

Happy Coding!
:)
 
Share this answer
 
v2
TableLayoutPanel---cell(colId,RowId)

                  __________________________
                 |  |      cell(1,0)      <-+--colTblLayoutPnl
                 |__|_______________________|  (AutoScroll=False)
                 |  |                       |
       cell(0,1) |  |      cell(1,1)      <-+--DetailTblLayoutPnl
RowTblLayoutPnl--+> |                       |  (AutoScroll=True)
                 |  |                       |
                 |__|_______________________|




If we use three tblLayout, two of them is use to define Row header and Column header.
The problem is when we scroll in DetailTable how to make Row header tblLayout and Column header tblLayout scroll ? HScroll ( Row Header tblLayout frezze , column header tblLayout Hscroll ) , VScroll ( Row Header tblLayout Vscroll, column header tblLayout frezze ).
 
Share this answer
 

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