I'm assigning a list to DataSource
, and in this assignment I'm concatenating the code with the company name, however, it loads the list with the first selected item.
How do I make the last record load pre-selected?
My code looks like this:
for (int i = 0; i < empresa.Count; i++)
{
empresa[i].ParEmpresa = empresa[i].ParCodigo + " - " + empresa[i].ParEmpresa;
}
ddlEmpIni.DataSource = empresa;
ddlEmpIni.DataTextField = "ParEmpresa";
ddlEmpIni.DataValueField = "ParCodigo";
ddlEmpIni.DataBind();