GridView BoundField break long string

GridView 列太长,设定ItemStyle-Width="200"无效

 

   <%--     <asp:BoundField DataField="Codes" HeaderText="扫描的码" ItemStyle-HorizontalAlign="center" ItemStyle-Width="200"/>--%>
                                <asp:TemplateField ItemStyle-Width="200px" HeaderText="扫描的码">
                                    <ItemTemplate>
                                        <div style="width: 200px;word-wrap:break-word; ">
                                            <%# Eval("Codes")%>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>

 

 

 

 

https://stackoverflow.com/questions/8587538/gridview-boundfield-break-long-string

 

posted @ 2021-10-14 14:50  BloggerSb  阅读(22)  评论(0编辑  收藏  举报