We help IT Professionals succeed at work.

MS VS-2005 Gridview --- Column Width

Mehram
Mehram asked
on
195 Views
Last Modified: 2013-11-26
I have a column in my gridview: Trailer # which is showing data like this

Trailer
   #
 LSB
 002

Result is required in this form:

Trailer #
LSB 002

I am using following code:
<asp:BoundField DataField="TrailerNo" HeaderText ="Trailer #" ReadOnly ="True" />

I want the gridview width automatically expened according to data length and do not break data in line.

Please help
Comment
Watch Question

CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
<asp:BoundField DataField="TrailerNo" HeaderText ="Trailer #" ReadOnly "True">
<ItemStyle wrap="False" ></ItemStyle>
<HeaderStyle wrap="False" ></HeaderStyle>
</asp:BoundField>

Error:
can not swich view: the end tag can not matching with start tag

Secondly I have more then 45 columns in this gridview. Is i have to set this with every one?
CERTIFIED EXPERT

Commented:
try setting up only for grid view

<HeaderStyle wrap="False" ></HeaderStyle>

Author

Commented:
Problem Solved:
---------------------
<asp:BoundField DataField="TrailerNo" HeaderText ="Trailer #" ReadOnly ="True" >
                            <ItemStyle Wrap="False" />
                            <HeaderStyle Wrap="False" />
                        </asp:BoundField>

Just I want to know I have set this with every column?
CERTIFIED EXPERT

Commented:
try to set
<HeaderStyle wrap="False" ></HeaderStyle> only once  
otherwise you nedd toset it for every
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.