设置 DataFormatString 进行格式化数据时默认情况下是不会起作用的还有设置HtmlEncode = "false" 具体为什么?以下几点1. 在GridView中的asp:BoundField使用DataFormatString必须设置属性HtmlEncode="False",否则不起作用。如果是字符串类型的不起作用,需要手动添加格式化字符串为DataFormatString="¥{0:C}"。

asp.net 2.0 中GridView里设置日期格式

在asp.net 1.0 中的datagrid 中 设置日期字段格式时用 DataFormatString="{0:yyyy-MM-dd}"即可。在gridview 中设置短日期格式 使用<asp:BoundField HeaderText="发表时间" DataField="PostTime" DataFormatString="{0:yyyy-MM-dd}" >时不会出现想要的显示效果, 页面显示格式为: 2006-11-1 0:00:00.

GridView中的时间格式化

数字、货币格式:在指定的格式符号后可以指定小数所要显示的位数。格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.完整日期时间格式 (long date + long time) dddd, MMMM dd, yyyy HH:mm:ss g 一般格式 (short date + short time) MM/dd/yyyy HH:mm G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss m,M 月日格式 MMMM dd s 适中日期时间格式 yyyy-MM-dd HH:mm:ss t 精简时间格式 HH:mm T 详细时间格式 HH:mm:ss.

asp.net数据格式的Format-- DataFormatString

格式 说明 输出格式d 精简日期格式 MM/dd/yyyyD 详细日期格式 dddd, MMMM dd, yyyyf 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mmF.完整日期时间格式(long date + long time)dddd, MMMM dd, yyyy HH:mm:ssg 一般格式 (short date + short time) MM/dd/yyyy HH:mmG 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ssm,M 月日格式 MMMM dds 适中日期时间格式 yyyy-MM-dd HH:mm:sst 精简时间格式 HH:mmT 详细时间格式 HH:mm:ss.

DataFormatString属性

数据实体中的一些字段可以直接绑定到界面中,但是有一些字段需要重新格式化格式。这里需要注意以下几点1. 在GridView中的asp:BoundField使用DataFormatString必须设置属性HtmlEncode="False",否则不起作用。2. 如果需要使用日期类型的格式化字符串,必须数据实体中对应的字段也应该日起类型的。3. 格式化字符串C代表货币单位,需要绑定的数据类型应该是数字类型的。如果是字符串类型的不起作用,需要手动添加格式化字符串为DataFormatString="¥{0:C}"。

GridView中的时间格式化

但是我在显示时间的时候,始终无法使用DataFormatString="0:yyyy-MM-dd"这个属性,使用了在页面上并没有想要的效果。--原始代码,绑定列代码--><asp:BoundField DataField="filltime" HeaderText="时间" DataFormatString="0:yyyy-MM-dd" ><HeaderStyle Width="20%" /></asp:BoundField><!--现起作用的绑定列代码--><asp:BoundField DataField="filltime" HeaderText="时间" DataFormatString="0:yyyy-MM-dd" HtmlEncode="False"><HeaderStyle Width="20%" /&g

DataFormatString格式化列信息

今天用GridView来显示数据,利用DataFormatString格式化列信息,可是发现页面并没有任何编码,格式化没有效果,最后查资料才知道。

DataFormatString--格式化字符串

2005.5  以C2格式化之后 ¥2,005.50128 以D格式化之后 1282005.5 以E2格式化之后 2.01E+0032005.5 以F4格式化之后 2005.50002005.5 以G格式化之后 2005.52005.5 以N3格式化之后 2,005.5000.25 以P格式化之后 25.00%128 以X格式化之后 802005.5 以00####.00格式化之后 002005.50.格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.冒号后的字符(常规示例中为B)指定值的显示格式       C 以货币格式显示数值。

the DataFormatString not work for the GridView BoundField problem

the DataFormatString not work for the GridView BoundField problem, it is caused by the new "HtmlEncode" setting of the GridView BoundField.

DataFormatString格式字符串

格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.完整日期时间格式 (long date + long time) dddd, MMMM dd, yyyy HH:mm:ss g 一般格式 (short date + short time) MM/dd/yyyy HH:mm G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss m,M 月日格式 MMMM dd s 适中日期时间格式 yyyy-MM-dd HH:mm:ss t 精简时间格式 HH:mm T 详细时间格式 HH:mm:ss.

用DataFormatString格式化GridView

格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.完整日期时间格式 (long date + long time) dddd, MMMM dd, yyyy HH:mm:ss g 一般格式 (short date + short time) MM/dd/yyyy HH:mm G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss m,M 月日格式 MMMM dd s 适中日期时间格式 yyyy-MM-dd HH:mm:ss t 精简时间格式 HH:mm T 详细时间格式 HH:mm:ss.

DataFormatString格式字符串

DataFormatString格式字符串 DataFormatString="{0:格式字符串}"格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.完整日期时间格式 (long date + long time) dddd, MMMM dd, yyyy HH:mm:ss g 一般格式 (short date + short time) MM/dd/yyyy HH:mm G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss m,M 月日格式 MMMM dd s 适中日期时间格式 yyyy-MM-dd HH:mm:ss t 精简时间格式 HH:mm T 详细时间格式 HH:mm:ss.

asp.net 2.0 中DataFormatString不起作用的解决方案

在VS2005中,你会发现DataFormatString不起作用了。

DataFormatString格式字符串

格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.完整日期时间格式 (long date + long time) dddd, MMMM dd, yyyy HH:mm:ss g 一般格式 (short date + short time) MM/dd/yyyy HH:mm G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss m,M 月日格式 MMMM dd s 适中日期时间格式 yyyy-MM-dd HH:mm:ss t 精简时间格式 HH:mm T 详细时间格式 HH:mm:ss.

asp.net 2.0 中GridView里设置日期格式

在asp.net 1.0 中的datagrid 中 设置日期字段格式时用 DataFormatString="{0:yyyy-MM-dd}"即可。在gridview 中设置短日期格式 使用<asp:BoundField HeaderText="发表时间" DataField="PostTime" DataFormatString="{0:yyyy-MM-dd}" >时不会出现想要的显示效果, 页面显示格式为: 2006-11-1 0:00:00.

asp.net 2.0 中GridView里设置日期格式

在asp.net 1.0 中的datagrid 中 设置日期字段格式时用 DataFormatString="{0:yyyy-MM-dd}"即可。在gridview 中设置短日期格式 使用<asp:BoundField HeaderText="发表时间" DataField="PostTime" DataFormatString="{0:yyyy-MM-dd}" >时不会出现想要的显示效果, 页面显示格式为: 2006-11-1 0:00:00.

asp.net数据格式的Format-- DataFormatString

格式 说明 输出格式d 精简日期格式 MM/dd/yyyyD 详细日期格式 dddd, MMMM dd, yyyyf 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mmF.完整日期时间格式(long date + long time)dddd, MMMM dd, yyyy HH:mm:ssg 一般格式 (short date + short time) MM/dd/yyyy HH:mmG 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ssm,M 月日格式 MMMM dds 适中日期时间格式 yyyy-MM-dd HH:mm:sst 精简时间格式 HH:mmT 详细时间格式 HH:mm:ss.

DataFormatString--格式化字符串

格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.完整日期时间格式 (long date + long time) dddd, MMMM dd, yyyy HH:mm:ss g 一般格式 (short date + short time) MM/dd/yyyy HH:mm G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss m,M 月日格式 MMMM dd s 适中日期时间格式 yyyy-MM-dd HH:mm:ss t 精简时间格式 HH:mm T 详细时间格式 HH:mm:ss.

DataFormatString--格式化字符串

格式 说明 输出格式 d 精简日期格式 MM/dd/yyyy D 详细日期格式 dddd, MMMM dd, yyyy f 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mm F.完整日期时间格式 (long date + long time) dddd, MMMM dd, yyyy HH:mm:ss g 一般格式 (short date + short time) MM/dd/yyyy HH:mm G 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ss m,M 月日格式 MMMM dd s 适中日期时间格式 yyyy-MM-dd HH:mm:ss t 精简时间格式 HH:mm T 详细时间格式 HH:mm:ss.

Asp.Net2.0中GridView的DataFormatString=&quot;{0:yyyy-MM-dd}&quot;不起作用解决办法

Net2.0中GridView的DataFormatString="{0:yyyy-MM-dd}"不起作用解决办法。<Columns>                <asp:BoundField DataField="EmployeeId" />                <asp:BoundField DataField="LastName" />                <asp:BoundField DataField="BirthDate" HtmlEncode ="false" DataFormatString="{0:yyyy-MM-dd}" /></Columns>

时间格式的设定

格式 说明 输出格式d 精简日期格式 MM/dd/yyyyD 详细日期格式 dddd, MMMM dd, yyyyf 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mmF.完整日期时间格式(long date + long time)dddd, MMMM dd, yyyy HH:mm:ssg 一般格式 (short date + short time) MM/dd/yyyy HH:mmG 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ssm,M 月日格式 MMMM dds 适中日期时间格式 yyyy-MM-dd HH:mm:sst 精简时间格式 HH:mmT 详细时间格式 HH:mm:ss.

asp.net数据格式的Format-- DataFormatString

asp.net数据格式的Format-- DataFormatString 我们在呈现数据的时候,不要将未经修饰过的数据呈现给使用者。其使用语法如下:DataFormatString="{0:格式字符串}"我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

在Asp.Net 2.0中应用DataFormatString

DataFormatString 属性语法如下: DataFormatString="{0:格式字符串}" 我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;另外在指定的格式符号后可以指定小数所要显示的位数。例如原来的数据为「1.56」,若格式设定为 {0:N1},则输出为「1.5」。其常用的数值格式如下表所示: 格式字符串   输入                         结果 "{0:C}"           12345.6789           $12,345.68 "{0:C}"           -12345.6789           ($12,345.68) "{0:D}"           12345                     12345 "{0:D8}"         12345                     00012345 "{0:E}"            12345.6789          1234568E+004 "{0:E10}"

解决gridview的dataformatstring无效

解决gridview的dataformatstring无效。

asp.net数据格式的Format-- DataFormatString

格式 说明 输出格式d 精简日期格式 MM/dd/yyyyD 详细日期格式 dddd, MMMM dd, yyyyf 完整格式 (long date + short time) dddd, MMMM dd, yyyy HH:mmF.完整日期时间格式(long date + long time)dddd, MMMM dd, yyyy HH:mm:ssg 一般格式 (short date + short time) MM/dd/yyyy HH:mmG 一般格式 (short date + long time) MM/dd/yyyy HH:mm:ssm,M 月日格式 MMMM dds 适中日期时间格式 yyyy-MM-dd HH:mm:sst 精简时间格式 HH:mmT 详细时间格式 HH:mm:ss.

Asp.Net2.0中GridView的DataFormatString=&quot;{0:yyyy-MM-dd}&quot;不起作用解决办法

Net2.0中GridView的DataFormatString="{0:yyyy-MM-dd}"不起作用解决办法。<Columns>                <asp:BoundField DataField="EmployeeId" />                <asp:BoundField DataField="LastName" />                <asp:BoundField DataField="BirthDate" HtmlEncode ="false" DataFormatString="{0:yyyy-MM-dd}" /></Columns>

ASP.NET 2.0 – 为什么替GridView的BoundField设定的DataFormatString没有效?

DataFormatString--格式化字符串

DataFormatString="{0:格式字符串}" 在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

按以下步骤

在Asp.Net 2.0中应用DataFormatString

DataFormatString 属性语法如下:DataFormatString="{0:格式字符串}"我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

GridView中使用DataFromatString

<asp:GridView ID="grvResult" runat="server" AutoGenerateColumns="False" Width="100%"> <Columns> <asp:BoundField HeaderText="预定日期" DataField="OperationDate" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="False"> </asp:BoundField> <asp:BoundField HeaderText="订单总计"  DataField="TotalRate" DataFormatString="{0:C}" HtmlEncode="False"> </asp:BoundField&g

ASP.NET数据格式DataFormatString详解

ASP.NET数据格式DataFormatString详解 我们在呈现数据的时候,不要将未经修饰过的数据呈现给使用者。其使用语法如下:DataFormatString="{0:格式字符串}"我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

DataFormatString格式化列信息

今天用GridView来显示数据,利用DataFormatString格式化列信息,可是发现页面并没有任何编码,格式化没有效果,最后查资料才知道。ASP.NET2.0出于安全性的考虑,除了设置DataFormatString,还需要设置 HtmlEncode = false 才可以。

DataFormatString 设置

其使用语法如下:DataFormatString="{0:格式字符串}"我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

GridView 中日期类型的显示方式补充

为了将长日期格式使用 DataFormatString 属性格式化为短日期显示方式,在网上找了些资料,开始时,按照我搜索到的文章的说明,设置DataFormatString="{0:yyyy-mm- dd}",结果,日期2005-11-27 12:54:33 秒的显示结果为2005-54-27,于是发现,如果月份使用小写m,取得的是时间中分钟(minute),而不是月份(Month)的值,因此,正确的设置应为DataFormatString="{0:yyyy-MM-dd}"。

asp.net数据格式的Format-- DataFormatString

其使用语法如下:DataFormatString="{0:格式字符串}"我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

数据格式的Format -- DataFormatString

数据格式的Format我们在呈现数据的时候,不要将未经修饰过的数据呈现给使用者。其使用语法如下:DataFormatString="{0:格式字符串}"我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

数据格式的Format -- DataFormatString

数据格式的Format我们在呈现数据的时候,不要将未经修饰过的数据呈现给使用者。其使用语法如下:DataFormatString="{0:格式字符串}"我们知道在DataFormatString 中的 {0} 表示数据本身,而在冒号后面的格式字符串代表所们希望数据显示的格式;

DataGrid, DataFormatString=&amp;quot;{0:yyyy-MM-dd}&amp;quot;

gridview DataFormatString 属性设置须知的更多相关文章

  1. Gridview利用DataFormatString属性设置数据格式

    首 先把Gridview的AutoGenerateColumns属性设为False(默认是False),DataField选择相应的字段,特别需要注 意的是要把需要设置的字段的HtmlEncode属性 ...

  2. DevExpress GridView属性设置 z

    本文主要总结控件的属性设置,附上图片,给大家一个参考.后续会给大家分享功能实现和使用的小技巧. GirdControl是数据的容器,它包含多种显示方式,GridView则是一种二维表格视图. 绑定数据 ...

  3. (转)DevExpress GridView属性设置

    GirdControl是数据的容器,它包含多种显示方式,GridView则是一种二维表格视图. 绑定数据源: List<Student> list = new List<Studen ...

  4. DEV中gridview常用属性的设置

    1.隐藏最上面的GroupPanel: gridView1.OptionsView.ShowGroupPanel=false; 2.得到当前选定记录某字段的值: sValue=Table.Rows[g ...

  5. C#中gridView常用属性和技巧介绍

    .隐藏最上面的GroupPanel gridView1.OptionsView.ShowGroupPanel=false; .得到当前选定记录某字段的值 sValue=Table.Rows[gridV ...

  6. DEV控件:gridControl常用属性设置(转载)

    特别长,先撸下来再说 1.隐藏最上面的GroupPanel  gridView1.OptionsView.ShowGroupPanel=false; 2.得到当前选定记录某字段的值  sValue=T ...

  7. DEV控件:gridControl常用属性设置

    1.隐藏最上面的GroupPanel  gridView1.OptionsView.ShowGroupPanel=false; 2.得到当前选定记录某字段的值  sValue=Table.Rows[g ...

  8. DEV控件GridControl常用属性设置

    1. 如何解决单击记录整行选中的问题 View->OptionsBehavior->EditorShowMode 设置为:Click 2. 如何新增一条记录 (1).gridView.Ad ...

  9. Dev中GridControl的GridView 基本样式设置

    基本样式图: 代码如下: /// <summary> /// gridView样式 /// </summary> /// <param name="gdv&qu ...

随机推荐

  1. 网络协议之UDP

    前言 TCP协议在不可靠的网络环境上提供了可靠的通信通道,隐藏了大量的底层细节,使应用程序更加简洁.但有些应用并不需要这么高的可靠性,并不需要按序交付,而且TCP为了提高可靠性也增加了延时,在某些对延 ...

  2. python图片处理和matlab图片处理的区别

    作者:波布兰链接:https://www.zhihu.com/question/28218420/answer/39904627来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明 ...

  3. JAVA复习笔记之GC部分

       前言:垃圾回收机制,大家都知道JAVA的垃圾回收都是JVM自动回收的,不需要程序员去管理.但是我们还是得知道原理才能在适当时机进行JVM调优 原理:当我们new 一个对象时JVM堆区就会分配一块 ...

  4. Linux学习笔记:crontab定时任务

    通过crontab 命令,我们可以在固定的间隔时间执行指定的系统指令或 shell script脚本.时间间隔的单位可以是分钟.小时.日.月.周及以上的任意组合.这个命令非常适合周期性的日志分析或数据 ...

  5. 大家来探讨下,IRepository 应该怎么定义?

    ORM已EF为例子:我见的最多的是泛型的IRepository, public partial interface IRepository<T> where T : BaseEntity{ ...

  6. overlay实现容器跨主机通信

    本节内容: Docker容器跨主机通信方案 环境信息 升级内核 安装docker 防火墙设置和开启内核转发 安装启动consul 启动Docker 创建overlay network 创建容器 测试容 ...

  7. CF 576A 猜数

    A给出一个数x,B每次猜一个y,A回答B,x是否可以被y整除,求出要猜的最小次数和需要猜的数. 枚举每个素数p,可以知道如果p^k<=n,则p^k一定需要选 Sample test(s)inpu ...

  8. 自定义Adapter为什么会重复多轮调用getView?——原来是ListView.onMeasure在作祟

    相信很多人在使用自定义Adapter的时候都遇到这样的问题: 假设Adapter数据源中只有30个Item,理论上每显示一个新的Item的时候就会调用一次getView,均显示一次的话是要调用getV ...

  9. Hive SQL综合案例

    一 Hive SQL练习之影评案例 案例说明 现有如此三份数据:1.users.dat 数据格式为: 2::M::56::16::70072, 共有6040条数据对应字段为:UserID BigInt ...

  10. ueditor初始化

    一.下载文件复制到项目中 二.复制表情文件 三.复制列表图片 四.修改ueditor.config.js文件 五.接着修改net文件下config.json文件 六.完蛋了,不支持IE8,版本替换为了 ...