格式化 DevExpress ASPxGridView 中的列?
有谁知道我如何格式化 DevExpress ASPxGridView 中的列。我拥有的是每天从 xml 文件生成的 xml 文件。我想做的是格式化特定值的列,例如,带有测量值的列,如果未填充,我想添加尾随零,即 1.2 到 1.200。我只遇到过在 ASPX 页面中完成的示例,并用代码构建了我的专栏。请帮忙提供最简单的解决方案或属性,谢谢。
Does anyone know how I could format columns in the DevExpress ASPxGridView. What I have is a xml file that is generated daily from an xml file. What I would like to do is format columns for specific values, for example, a column with measurements, I want to add trailing zeros if these are not filled, i.e. 1.2 to 1.200. I have only come across examples done in the ASPX page and have built my columns in code. Please assist with the simplest solutions or property, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在您的 .aspx 页面中,您可以执行此操作,将列格式设置为小数点后 0 位的美元金额。
在代码后面将 CellEditorInitialize 绑定到自定义事件处理程序,如下所示:
In your .aspx page you can do this to format your column to dollar amount with 0 decimal place
In Code behind bind CellEditorInitialize to a custome event handler something like:
无需在活动中这样做。当然这并不完整,但你已经明白了:
No need to do it in an event. This is not complete of course but you get the idea:
在后面的代码中,您可以使用
CustomColumnDisplayText
事件:方法文档:
http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_CustomColumnDisplayTexttopic
In code behind you can use
CustomColumnDisplayText
event:Method documentation:
http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_CustomColumnDisplayTexttopic