Can I associate more than one column with a DropDownList DataTextField?

Below is my code ...

DropDownList2.DataSource = td.DataSet DropDownList2.DataSource = td DropDownList2.DataTextField = td.Columns ("Name"). ColumnName.ToString DropDownList2.DataValueField = td.Columns ("VendorCode"). ColumnName.ToString DropDownList2.DataBind ()

Now I have a requirement to show the type of provider and the name of the supplier in the drop-down list. The supplier type can be obtained using this statement ...

td.Columns ("VendorType"). ColumnName.ToString

Can this be done? Please, help

+3
source share
2 answers

DataTextField . , , DataTextField.

+3

, .

, DataSet DataTable, , Name, VendorType, , . DataColumn.Expression. , .

+2

Source: https://habr.com/ru/post/1709273/


All Articles