Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

width of grid view boundfield

Tags:

I can not set the width of bound field. Is there any problem in the following markup.

 <asp:BoundField DataField="UserName" HeaderText="User Name"                    meta:resourcekey="BoundFieldUNCUserNameResource1">         <HeaderStyle Width="50%" />  </asp:BoundField> 

enter image description here

Please refer to the image. I set width using the following. The yellow colored numbers are corresponding width. The marked user name is always Wrapped even I set a width to a large value (say 50%) and set Wrap="false".

<HeaderStyle Width="20%" Wrap="true" /> <ItemStyle Width="20%" Wrap="true" /> 
like image 290
mmk_open Avatar asked Jun 21 '11 05:06

mmk_open


People also ask

How to set width of BoundField in GridView in asp net?

I set width using the following. The yellow colored numbers are corresponding width. The marked user name is always Wrapped even I set a width to a large value (say 50%) and set Wrap="false".

What is BoundField in GridView in asp net c#?

The BoundField class is used by data-bound controls (such as GridView and DetailsView) to display the value of a field as text. The BoundField object is displayed differently depending on the data-bound control in which it is used.


1 Answers

Try This:

ItemStyle-Width="50%" ItemStyle-Wrap="false" in the BoundField tag

like image 136
Saurabh Avatar answered Dec 06 '22 18:12

Saurabh