This is a migrated thread and some comments may be shown as answers.

Set GridViewDataColumn width to Auto

2 Answers 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nalini
Top achievements
Rank 1
Nalini asked on 27 May 2015, 07:50 PM

Hello,

 

Can someone tell how to set GridViewDataColumn width to Auto in C#. Below is the sample code.

GridViewDataColumn firstName= new GridViewDataColumn();

firstName.Header = "FirstName";

firstName.Width=  Auto ?  //something like this?

 

 

Thanks,

Nalini

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 28 May 2015, 01:48 PM
Hello Nalini,

You can set the Width like so:

firstName.Width = new GridViewLength(0, GridViewLengthUnitType.Auto)


Regards,
Dimitrina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nalini
Top achievements
Rank 1
answered on 28 May 2015, 03:52 PM

Thank You!

 

Best Regards, 

Nalini

Tags
GridView
Asked by
Nalini
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Nalini
Top achievements
Rank 1
Share this question
or