Sometimes in gridview we have a column which has too much information so it is not shown properly on page.
We can achieve with the help of CSS.
Happy Coding!!
We can achieve with the help of CSS.
.word_wrapWe have defined a css class, and we can assign this cssclass to column which has too much information.
{
white-space: pre; /* CSS 2.0 */
white-space: pre-wrap; /* CSS 2.1 */
white-space: pre-line; /* CSS 3.0 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -hp-pre-wrap; /* HP Printers */
word-wrap: break-word; /* IE 5+ */
}
<asp:TemplateField HeaderText="Name On Document" meta:resourcekey="HeaderText_NameOnResource1">
<HeaderStyle Width="100px" Font-Bold="true" />
<ItemTemplate>
<div style="word-wrap: break-word; width: 100px;">
<%# Eval("NameOnDocument")%>
</div>
</ItemTemplate>
<ItemStyle Width="100px" CssClass="word_wrap" Wrap="true" />
</asp:TemplateField>
Happy Coding!!
No comments:
Post a Comment