多行GridView单元格数据 [英] GridView Cell Data In MultipleLines

查看:79
本文介绍了多行GridView单元格数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个包含带有messageid和messageDesc的表的应用程序,并且在messageDesc列中有消息描述,当我尝试将gridview绑定到messagedesc列时,它出现了一行,因此我需要沿水平方向滚动,所以我想在gridview的消息列中多行显示消息描述.

我已经尝试了itemstyle属性,但是它不起作用,请为我建议相同的解决方案.也无法更改数据库消息的内容.


谢谢Advanced

Hi,

I Have application which contains the table with messageid and messageDesc,and inside messageDesc column there is message description,when i am trying to bind to gridview to the the messagedesc column then its coming a single line so i need to scroll in horizontal direction ,so i want to show the message description on multiple lines in gridview''s message column.

I have tried by itemstyle attribute but its not working, please suggest me solution for the same.also i can''t change the database message content.


Thanks in Advanced

推荐答案

设置像素的网格列宽度.
set the grid column width in pixel.


像这样尝试
在项目模板中放置div标签,并在div标签内放置消息列,并为div指定固定宽度

< asp:xmlns:asp =#unknown">
try like this
place a div tag in item template and inside the div tag put your message column and give fixed width for div
ex
<asp: xmlns:asp="#unknown">
GridView ID="GridView2" runat="server" AutoGenerateColumns="False"          

      <Columns>
<asp:templatefield headertext="Name" headerstyle-font-size="Medium" headerstyle-width="150px" headerstyle-font-names="Microsoft Sans Serif">
                  
                    <itemtemplate>
                     <div style="width :150px;font-size :medium ;font-family :Microsoft Sans Serif  ">
                        <asp:label id="lblID" runat="server" text="<%# DataBinder.Eval(Container.DataItem,"Name") %>"></asp:label>
                  </div>
                    </itemtemplate>
 </asp:templatefield>


这篇关于多行GridView单元格数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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