GridView控件绑定列打破长字符串 [英] GridView BoundField break long string

查看:111
本文介绍了GridView控件绑定列打破长字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的GridView一个绑定列有很长的字符串的无空格并调整其大小GridView控件。如何打破长字符串在GridView的列?

One of BoundField in my GridView has very long string without spaces and it resize GridView. How to break long strings in GridView columns?

推荐答案

我发现这在我的情况下工作的解决方案

I have found the solution which works in my situation

 <asp:TemplateField ItemStyle-Width="350px" HeaderText="Source">
        <ItemTemplate>
            <div style="width: 350px;word-wrap:break-word; ">
                <%# Eval("Source")%>
            </div>
        </ItemTemplate>
    </asp:TemplateField>

这篇关于GridView控件绑定列打破长字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆