Binding to a dropdownlist with row numbers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    Binding to a dropdownlist with row numbers

    Is there a way to databind to a dropdownlist from a dataTable where you have
    the value as the row number of the DataTable?

    In the following, I'd like to change "CountryCod e" with the row number (0
    based) of the DataTable.

    Country.DataSou rce=DataTable;
    Country.DataTex tField= "CountryNam e";
    Country.DataVal ueField="Countr yCode";
    Country.DataBin d();
    Country.Items.I nsert(0, "Select Country");

    Thanks,

    Tom


Working...