Partilhar via


DataTextField Property for French (Canada)

  Microsoft Speech Technologies Homepage

Gets or sets the field of the DataSource property that provides the grammar for each item in the list. Read/write.

Usage

ASP.NET markup: <speech:DataTableNavigator DataTextField="..." />
Get value: String = DataTableNavigator.DataTextField;
Set value: DataTableNavigator.DataTextField = String;
Data type: String
Required: No

Remarks

The value of the DataTextField property is the name of one data column in the DataSource property. The control builds an array that contains each element in the DataTextField column and links each element to its row in the DataSource. If the value of the control's AccessMode property is Fetch or Select, the control navigates to the appropriate row when the user speaks an element of this array.

Data fields in the column specified by the DataTextField property consist of a single text element or multiple text elements separated by the pipe character ("|"). In the latter case, the user can speak any of the pipe-delimited elements in the data field in order to navigate to that data row.

The control throws an ArgumentException if DataTextField is specified but the data source does not contain a corresponding column, or if an element can be used to select more than one value.

Example

The following code example is taken from the DataTableNavigator Example. The DataTextField references the "AirportCode" column, which contains the city's name and airport code letters. For example, the "AirportCode" field for Los Angeles is "Los Angeles|LAX". When the control asks for the next command, the user can navigate to the row for Los Angeles by saying either "Los Angeles" or "LAX".

<form id="Form1" method="post" runat="server">
  ...
  <speech:DataTableNavigator 
    id="Navigator1" 
    runat="server" 
    InitialTimeout="3000" MaxTimeout="30000" ShortInitialTimeout="500"
    AccessMode="Select"
    DataSource="<%# dataSet11 %>" 
    DataMember="CityInfo" 
    DataHeaderFields="ville,airport code,état"
    DataContentFields="maximum,minimum,conditions,divertissement" 
    DataTextField="AirportCode"
    DataBindField="State"
    QuestionPrompt="prochaine commande s'il-vous-plaît" 
    PromptSelectFunction="promptSelectFunction" 
    SemanticItem="siDataTableNavigator">
    <HeaderTemplate>
      le temps maintenant dans 
      <%# DataBinder.Eval(Container.DataItem, "City")%>,
      <%# DataBinder.Eval(Container.DataItem, "State")%>
    </HeaderTemplate>
    <ContentTemplate>
      Currently <%# DataBinder.Eval(Container.DataItem, "City")%> is
      <%# DataBinder.Eval(Container.DataItem, "Conditions")%>,
       avec un maximum de  <%# DataBinder.Eval(Container.DataItem, "High")%>
       et un minimum de  <%# DataBinder.Eval(Container.DataItem, "Low")%> degrés.
    </ContentTemplate>
    <CommandRules>
      <speech:CommandRule Type="Exit"></speech:CommandRule>
      <speech:CommandRule Type="Next"></speech:CommandRule>
      <speech:CommandRule Type="Previous"></speech:CommandRule>
      <speech:CommandRule Type="Read"></speech:CommandRule>
    </CommandRules>
  </speech:DataTableNavigator>
  ...
</form>

See Also

DataTableNavigator Class | DataTableNavigator Constructor | DataTableNavigator Members | DataTableNavigator Properties | DataTableNavigator Methods | DataTableNavigator Events | DataTableNavigator Remarks | DataTableNavigator Client Object