This normally used for a generated business object. (nettier)
get the business object.
create a new Property Display Name, which based on property FirstName and Surname:
The first line is important for data Binding. If you bind the property to a gridview, you need this line code. the example code should exist the its base entity class, which generated by nettier.
[DescriptionAttribute(""), System.ComponentModel.Bindable(System.ComponentModel.BindableSupport.Yes)]
public string DisplayName
{
get
{
if (!String.IsNullOrEmpty(FirstName))
{
if (!String.IsNullOrEmpty(Surname))
{
return string.Format("{0} {1}", FirstName, Surname);
}
else
{
return FirstName;
}
}
else
{
if (!String.IsNullOrEmpty(Surname))
{
return Surname;
}
else
{
return "N / A";
}
}
}
}
Then you can find the new property in the datasource window. (Data -> show DataSource).