人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

按以下步驟

按以下步驟

更新時間:2022-07-10 文章作者:未知 信息來源:網絡 閱讀次數:

1.打開開始菜單
2.選擇程序中的Microsoft .NET FrameWork
3.選擇Documention
4.選擇Index選項卡
5.輸入“DataFormatString property”
6.雙出出現的第一個關鍵詞。
7.以下出現內容:
 .NET Framework Class Library 

BoundColumn.DataFormatString PropertySee Also
BoundColumn Class | BoundColumn Members | System.Web.UI.WebControls Namespace | String.Empty | DataGrid | Formatting Overview
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP
Language
C#

C++

JScript

Visual Basic

Show All

This is preliminary documentation and subject to change.
Send feedback on this topic.


Gets or sets the string that specifies the display format for items in the column.

[Visual Basic]
Overridable Public Property DataFormatString As String
[C#]
public virtual string DataFormatString {get; set;}
[C++]
public: __property virtual String* get_DataFormatString();
public: __property virtual void set_DataFormatString(String*);
[JScript]
public function get DataFormatString() : String;
public function set DataFormatString(String);
Property Value
A formatting string that specifies the display format of items in the column. The default value is String.Empty.

Remarks
Use the DataFormatString property to provide a custom format for the items in the column.

The data format string consists of two parts, separated by a colon, in the form {A:Bxx}. For example, the formatting string, {0:D2}, would format the cell to display a number with two decimal places.

Note The entire string must be enclosed in curly braces to denote that it is a format string and not a literal string. Any text outside the curly braces is displayed as literal text.
The value before the colon ( A in the general example) specifies the parameter index in a zero-based list of parameters.

Note This value can only be set to 0 because there is only one value in each cell.
The character after the colon ( B in the general example) specifies the format to display the value in. The following table lists the common formats.

Format Character Description
CDisplays numeric values in currency format.
DDisplays numeric values in decimal format.
EDisplays numeric values in scientific (exponential) format.
FDisplays numeric values in fixed format.
GDisplays numeric values in general format.
NDisplays numeric values in number format.
XDisplays numeric values in hexadecimal format.

Note The format character is not case-sensitive, except for X, which displays the hexadecimal characters in the case specified.
The value after the format character ( xx in the general example) specifies the number of significant digits or decimal places to display the value in.

For more information on formatting strings, see Formatting Overview.

Example
[Visual Basic, C#] The following example demonstrates how to use the DataFormatString property to specify currency format for the column that displays the prices in of the DataGrid control.

[C#]
<%@ Import Namespace="System.Data" %>

<html>
 <script language="C#" runat="server">

ICollection CreateDataSource()
{
 DataTable dt = new DataTable();
 DataRow dr;

 dt.Columns.Add(new DataColumn("IntegerValue", typeof(Int32)));
 dt.Columns.Add(new DataColumn("StringValue", typeof(string)));
 dt.Columns.Add(new DataColumn("CurrencyValue", typeof(double)));

 for (int i = 0; i < 9; i++)
 {
dr = dt.NewRow();

dr[0] = i;
dr[1] = "Item " + i.ToString();
dr[2] = 1.23 * (i + 1);

dt.Rows.Add(dr);
 }

 DataView dv = new DataView(dt);
 return dv;
}

void Page_Load(Object sender, EventArgs e)
{

 if (!IsPostBack)
 {
// need to load this data only once
ItemsGrid.DataSource= CreateDataSource();
ItemsGrid.DataBind();
 }
}

 </script>

<body>

 <form runat=server>

<h3><font face="Verdana">BoundColumn Example</font></h3>

<b>Product List</b>

<asp:DataGrid id="ItemsGrid"
 BorderColor="black"
 BorderWidth="1"
 CellPadding="3"
 AutoGenerateColumns="false"
 runat="server">

 <HeaderStyle BackColor="#00aaaa">
 </HeaderStyle>

 <Columns>

<asp:BoundColumn
 HeaderText="Number"
 DataField="IntegerValue">
</asp:BoundColumn>

<asp:BoundColumn
 HeaderText="Description"
 DataField="StringValue">
</asp:BoundColumn>

<asp:BoundColumn
 HeaderText="Price"
 DataField="CurrencyValue"
 DataFormatString="{0:c}">
</asp:BoundColumn>

 </Columns>

</asp:DataGrid>

 </form>

</body>
</html>
[Visual Basic]
<%@ Import Namespace="System.Data" %>

<html>
 <script language="VB" runat="server">
 Function CreateDataSource() As ICollection
 Dim dt As New DataTable()
 Dim dr As DataRow
 
 dt.Columns.Add(New DataColumn("IntegerValue", GetType(Int32)))
 dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
 dt.Columns.Add(New DataColumn("CurrencyValue", GetType(Double)))
 
 Dim i As Integer
 For i = 0 To 8
 dr = dt.NewRow()
 
 dr(0) = i
 dr(1) = "Item " + i.ToString()
 dr(2) = 1.23 *(i + 1)
 
 dt.Rows.Add(dr)
 Next i
 
 Dim dv As New DataView(dt)
 Return dv
 End Function 'CreateDataSource


 Sub Page_Load(sender As Object, e As EventArgs)
 
 If Not IsPostBack Then
 ' need to load this data only once
 ItemsGrid.DataSource = CreateDataSource()
 ItemsGrid.DataBind()
 End If
 End Sub 'Page_Load
 </script>
<body>

 <form runat=server>

<h3><font face="Verdana">BoundColumn Example</font></h3>

<b>Product List</b>

<asp:DataGrid id="ItemsGrid"
 BorderColor="black"
 BorderWidth="1"
 CellPadding="3"
 AutoGenerateColumns="false"
 runat="server">

 <HeaderStyle BackColor="#00aaaa">
 </HeaderStyle>

 <Columns>

<asp:BoundColumn
 HeaderText="Number"
 DataField="IntegerValue">
</asp:BoundColumn>

<asp:BoundColumn
 HeaderText="Description"
 DataField="StringValue">
</asp:BoundColumn>

<asp:BoundColumn
 HeaderText="Price"
 DataField="CurrencyValue"
 DataFormatString="{0:c}">
</asp:BoundColumn>

 </Columns>

</asp:DataGrid>

 </form>

</body>
</html>
[C++, JScript] No example is available in C++ or JScript. To view a Visual Basic or C# example, click the Language Filter buttonin the upper-left corner of the page.

Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP

See Also
BoundColumn Class | BoundColumn Members | System.Web.UI.WebControls Namespace | String.Empty | DataGrid | Formatting Ove

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 开封县| 桃园市| 厦门市| 安达市| 鹤岗市| 克东县| 修文县| 罗平县| 宜城市| 项城市| 宁阳县| 体育| 许昌市| 霸州市| 临颍县| 得荣县| 大同县| 长乐市| 马尔康县| 永宁县| 张家港市| 广水市| 昌都县| 呈贡县| 广东省| 新化县| 花垣县| 连云港市| 红安县| 华安县| 肥西县| 饶河县| 嘉义县| 蓬安县| 洪湖市| 五大连池市| 昭苏县| 招远市| 肇庆市| 宝坻区| 万年县|