Hi,
I have this problem. I want to have a drop-down which will have as text: the name of a depot and the description of that depot.
E.G.
Depot 01/ Lake Central
Depot 02/ Germany
I have created this function to make the binding:
private void BindDdSource()
{
DepotCollection depots = new DepotCollection();
IPredicateExpression filter = new PredicateExpression();
filter.Add(PredicateFactory.CompareValue(DepotFieldIndex.ID, ComparisonOperator.NotEqual,ConfigurationSettings.AppSettings["DrugDestructionFacilityID"].ToString()));
ISortExpression sorter = new SortExpression(SortClauseFactory.Create(DepotFieldIndex.ID, SortOperator.Ascending));
depots.GetMulti(filter,0,sorter);
this.DdSource.DataSource = depots;
this.DdSource.DataTextField = "ID";
this.DdSource.DataValueField = "ID";
this.DdSource.DataTextFormatString = "Depot: {0}";
this.DdSource.DataBind();
}
But I don't know how to define the DataTextFormatString or some other parameter to make this work on the fly? Is this possible to make it work on the fly or I just have to this manually?
Thanks,
MM