DataSource Property for French (Canada)
Gets or sets the source of values to bind to the ListSelector control. Read/write.
Usage
ASP.NET markup: | <speech:ListSelector DataSource="..." /> |
Get value: | Object = ListSelector.DataSource; |
Set value: | ListSelector.DataSource = Object; |
Data type: | Object |
Required: | Yes |
Remarks
The DataSource property is the same as that used in other ASP.NET controls. For more information about ASP.NET data binding, see Accessing Data with ASP.NET.
The resolved data source (DataSource and DataMember) must be of one of the following types:
- An array
- An implementer of IList, provided the implementer has a strongly typed Item property (that is, if the Type is not Object). To accomplish this, make the default implementation of Item private. To create an IList that follows the rules of a strongly typed collection, derive from CollectionBase.
- An implementer of ITypedList.
For more information, see the section titled Generic Collection Types in the .NET Framework Developer's Guide.
The control throws an ArgumentNullException if DataSource is not specified.
Example
<form id="Form1" method="post" runat="server">
...
<speech:semanticmap ID="SemanticMap1" runat="server">
<speech:SemanticItem ID="SemanticItem1" runat="server" >
</speech:SemanticItem>
</speech:semanticmap>
<speech:ListSelector ID=ListSelector1 runat="server"
SemanticItem="SemanticItem1"
QuestionPrompt="a quel employé voulez-vous parler?"
DataSource="<%# CorpData %>"
DataMember="Employee"
DataTextField="FirstName"
DataBindField="PhoneExt"
<GrammarTemplate>
<%# DataBinder.Eval(Container.DataItem, "FirstName") %>
|
<%# DataBinder.Eval(Container.DataItem, "LastName") %>
|
<%# DataBinder.Eval(Container.DataItem, "FirstName") %>
<%# DataBinder.Eval(Container.DataItem, "LastName") %>
</GrammarTemplate>
FirstInitialTimeout="0">
</speech:ListSelector>
...
</form>
See Also
ListSelector Class | ListSelector Constructor | ListSelector Members | ListSelector Properties | ListSelector Methods | ListSelector Events | ListSelector Remarks | ListSelector Client Object