• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • 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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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