Click here to Skip to main content
15,074,394 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone tell me, how can i resize width of a particular column during runtime in c#?

Want to move or resize that particular column dynamically during mousemove event in tablelayoutpanel control?

Help me...
Posted

Maybe 'Googling' is a good idea? Check here!
   
v2
Comments
srinivasan_indian 2-Dec-11 2:25am
   
Page not found..
Scubapro 2-Dec-11 2:31am
   
Sorry about that! Please try again.
srinivasan_indian 2-Dec-11 2:37am
   
Yeah I tried this before itself. Its moving some point only. I will pos my code,please check it and help me..

private void tableLayoutPanel1_MouseMove(object sender, MouseEventArgs e) { try

{ if (resizing) { if (rbColumn.Checked) {

columnStyles[GColumn].SizeType = SizeType.Absolute;

columnStyles[GColumn].Width += e.X - columnStyles[GColumn].Width; } else {

rowStyles[GRow].SizeType = SizeType.Absolute;

rowStyles[GRow].Height += e.Y - rowStyles[GRow].Height; } } }
catch (Exception ex)
{ //MessageBox.Show(ex.ToString());
} }

I used this code to resize the column dynamically. But its moving the particular column with the help of GColumn value as well as the next columns. Want to move only the specific column.. Help me..
   
Comments
srinivasan_indian 2-Dec-11 22:30pm
   
Thanks for your reply. But I want to do it in tablelayoutpanel control.. Just check my above posted code and help me for the same...

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