asp.net gridview简单问题希望有人可以回答^ _ ^ [英] asp.net gridview simple question hope someone can answer ^_^

查看:68
本文介绍了asp.net gridview简单问题希望有人可以回答^ _ ^的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在gridview的一列上有两个数据字段?在我的数据库上,我有名字和姓氏,在网格视图中,基本上我希望它们位于与标题字段名称"相同的列中.我应该使用模板字段吗?喜欢这个吗?(我猜)

Is it possible to have two datafield on one column of a gridview? Example on my database I have firstname and lastname, basically i want in grid view is that they are in the same columns with the header field "Name". Should i use template field? like this one?(my guess)

<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label ID="lblId" runat="server" Text='<%# Eval("Firstname")%>'> </asp:Label>
<asp:Label ID="lblId" runat="server" Text='<%# Eval("Lastname")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>


如果我使用该代码,是否可以在它们之间添加空间?谢谢,谢谢您.madams


and if I use that code can i add space between them? Thanks and more power sirs madams

推荐答案

是的.您可以通过这种方式使用.
您还可以在它们之间包含空格
按键盘上的空格键将不起作用,您需要使用

& nbsp;
Yes You can use in this way.
you can also include space between them
pressing space button on keyboard will not work you need to use

&nbsp;


,您可以使用& nbsp;在两个标签之间
you can Use &nbsp; between two labels


这篇关于asp.net gridview简单问题希望有人可以回答^ _ ^的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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