DataPointCollection.DataBind(IEnumerable, String, String, String) 方法

定义

将数据点的 X 值、Y 值和属性值(如 Tooltip 或 LabelStyle)绑定到数据源的数据。Data binds the X-value, Y-value(s) and property values of the data points, such as Tooltip or LabelStyle, to the data source.

public:
 void DataBind(System::Collections::IEnumerable ^ dataSource, System::String ^ xField, System::String ^ yFields, System::String ^ otherFields);
public void DataBind (System.Collections.IEnumerable dataSource, string xField, string yFields, string otherFields);
member this.DataBind : System.Collections.IEnumerable * string * string * string -> unit
Public Sub DataBind (dataSource As IEnumerable, xField As String, yFields As String, otherFields As String)

参数

dataSource
IEnumerable

数据源。The data source.

xField
String

用于 X 值的字段的名称。The name of the field for X-values.

yFields
String

一个逗号分隔的列表,其中列出了用于 Y 值的字段的名称。A comma separated names of the fields for Y-values.

otherFields
String

具有绑定规则的其他数据点属性采用以下格式:PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]]。Other data point properties with binding rules, in the format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]].

例如:“Tooltip=Price{C1},Url=WebSiteName”。For example: "Tooltip=Price{C1},Url=WebSiteName".

注解

数据源可以是 Ole (SQL) DataReader,DataView,DataSet,DataTable 或 DataRow。The data source can be the Ole(SQL)DataReader, DataView, DataSet, DataTable or DataRow.

适用于