表格列的拳头值显示为网格标题 [英] Table column fist value display as Heading of grid

查看:66
本文介绍了表格列的拳头值显示为网格标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据库在该表中包含表lib_test,例如:
pass,%pass,fail,%fail.these列包含表中的一些数据,我想将该列的第一条记录显示为该特定表的标题.

例如:通过和失败列包含类似
的数据
通过失败
是否

是否


像这样,在列顶部应该是UI上的网格标题.如果列中包含空白,则标题也应显示为blank.Csharp&asp.net中的工作方式.列名应根据列的第一个值动态更改.

Database contain table lib_test in that table some column like:
pass,%pass,fail,%fail.those column contain some data in table i want to display first record of column as heading from that particular table.

e.g: pass & fail column contain data like

pass Fail
yes No

Yes No


like this which on top in column that should be display heading of grid on UI. if column contain blank then heading should also display as blank.how it work in Csharp & asp.net. column name should be change dynamically as per column first value.

推荐答案

Ravi,

在这种情况下,我假设您是ASP.net的新手,因为这样做非常简单.尝试这样:
Hi Ravi,

In this case I assume that you''re a newbie to ASP.net because it''s quite simple to do. try like this:
<asp:GridView ID="GRDAvgInOut" runat="server" AutoGenerateColumns="True"
CellPadding="4" ForeColor="#333333" GridLines="None"  ShowHeaderWhenEmpty="True">
</asp:GridView> 




确保将Gridview的"ShowHeaderWhenEmpty"属性保持为"True".
将数据表绑定到此网格,我确定您已完成.

快乐编码:)




make sure to keep "ShowHeaderWhenEmpty" property to "True" of Gridview.
Bind the datatable to this grid and I''m sure you''re done.

Happy Coding :)


这篇关于表格列的拳头值显示为网格标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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