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

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
0
Mehram
Asked:
Mehram
  • 3
  • 2
1 Solution
 
Pratima PharandeCommented:
<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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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