如何在Gridview中显示冒号以进行时间显示 [英] how to display colon in Gridview for time display
问题描述
嗨朋友们,
正在使用.net工作(asp.net c#,SqlServer 2005)
我正在开发Gridview任务。
在这个Gridview中,它包含用于输入数据的Footer文本框。所以它的工作正常。
我的要求是:
在这个Gridview中我有一个文本框可以输入时间。一般情况下我们输入的时间为1300.
因此在gridview中显示为13:00。
请输入1300后输入冒号的解决方案。
i需要它为13:00
帮助。
谢谢
Hi Friends,
am working on .Net using (asp.net c#, SqlServer 2005)
iam working on Gridview Task.
In this Gridview, it contains Footer textboxes to enter the data. so its works fine.
my requirement is :
In this Gridview i have a textbox to enter time. Generally we will enter time as 1300.
so in gridview it should display as 13:00.
Please can you give me the solution to add colon after time entered as 1300.
i need it as 13:00
Help.
Thanks
推荐答案
解决此问题有两种可能性。
一个是在GridView中使用MaskedTextBox。
以下是关于这个主题的一些讨论 -
http://www.c-sharpcorner.com/Forums/Thread/195963/masked-textboxes-and -gridview.aspx [ ^ ]
http:// bytes.com/topic/net/answers/716606-mas kededit-control-gridview [ ^ ]
另一种方法是使用String.Format
[ ^ ]。
There are two possibilities of addressing this issue.
One would be to use a MaskedTextBox inside the GridView.
Here are some discussions on this topic -
http://www.c-sharpcorner.com/Forums/Thread/195963/masked-textboxes-and-gridview.aspx[^]
http://bytes.com/topic/net/answers/716606-maskededit-control-gridview[^]
The other would be to format text inside textbox using theString.Format
[^].
这篇关于如何在Gridview中显示冒号以进行时间显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!