• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 560
  • Last Modified:

How do I resize width of a windows user control dynamically?

I am developing a user control which have only a datagridview in it. Now I want to increase the width of the control dynamically according to the width of the datagridview. I have tried to set the this.Width property of the control, but it is not changing. I am using Visual studio 2010 as IDE and my back end code is in C#
0
ccrenil
Asked:
ccrenil
  • 3
  • 2
2 Solutions
 
guveraCommented:
0
 
guveraCommented:
Hi,
 
   Check another link.

  http://forums.asp.net/t/1266861.aspx/1

Regards
Guvera
0
 
ccrenilAuthor Commented:
@guvera

Thanks for the reply. But i didn't get a solution on this.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
What is the UserControl being displayed in?  If you have any of its Anchor or Dock properties set, then this could override your manual setting.
0
 
ccrenilAuthor Commented:
Thanks all for your prompt reply. I got the solution. I was trying to set the width of the user control at run time and it never changed. But when I set the width of the datagridview inside the control,it automaticaly adjusted its width according to the datagridview's width.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now