custom format Property of business object for the data binding
2011-08-03 00:55
567 查看
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.
Then you can find the new property in the datasource window. (Data -> show DataSource).
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).
相关文章推荐
- Error:Could not get unknown property ‘apkVariantData’ for object of type com.android.build.gradle.in
- org.springframework.data.mapping.model.MappingException: No id property found for object of type
- Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=M
- Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=M
- Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=
- Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=M
- Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=M
- Data format for the interchange of fingerprint
- Property 'edgesForExtendedlayout' not found on object of type
- Question 30: What is the order of destructor calls for an object of class Y inherited from class X that has an object of class A
- 完全解决struts启动时报错:The content of element type "struts-config" must match "(data-sources?,form-beans?,global-exceptions?,global-for
- Automating the Creation of Data-Rich Business Documents with Word 2007 and Visual Basic 2005
- Error:Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apk
- Oracle AWR 报告中 No data exists for this section of the report 说明
- The Binding of a Data Member
- android studio3.0 编译 Cannot set the value of read-only property 'outputFile' for apkVariantOutputImp
- Automating the Creation of Data-Rich Business Documents with Word 2007 and ASP.NET
- Error:(45, 0) Cannot set the value of read-only property 'outputFile' for ...
- BigQueue:The Architecture and Design of a Publish & Subscribe Messaging System Tailored for Big Data
- the DataFormatString not work for the GridView BoundField problem