mmk_open mmk_open - 1 year ago 116
ASP.NET (C#) Question

width of grid view boundfield

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

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

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" />

Answer Source

Try This:

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download