MS VS-2005 Gridview --- Column Width

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
MehramAsked:
Who is Participating?
 
Pratima PharandeConnect With a Mentor Commented:
<asp:BoundField DataField="TrailerNo" HeaderText ="Trailer #" ReadOnly ="True" >
<ItemStyle wrap="False" ></ItemStyle>
<HeaderStyle wrap="False" ></HeaderStyle>
</asp:BoundField>
0
 
MehramAuthor 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?
0
 
Pratima PharandeCommented:
try setting up only for grid view

<HeaderStyle wrap="False" ></HeaderStyle>
0
 
MehramAuthor 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?
0
 
Pratima PharandeCommented:
try to set
<HeaderStyle wrap="False" ></HeaderStyle> only once  
otherwise you nedd toset it for every
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.

All Courses

From novice to tech pro — start learning today.