. Net learning Diary
16:29:30 read 299 comments 0 font size: large, medium, and small subscriptions
Boundfield can only implement one fixed display format, while templatefield can implement any display format you want to achieve. Therefore, templatefield is more flexible, but sometimes it is wise to use a cool tool.
Bytes -----------------------------------------------------------------------------------------------------------
Boundfield: simple data binding, convenient and fast
Templatefield: In addition to binding data, you can also set controls and complex styles.
Bytes -----------------------------------------------------------------------------------
Boundfield is used for simple and fixed data display.
Templatefield is flexible and can be used in combination for displaying complex data.
Bytes --------------------------------------------------------------------------------------------------
Boundfield is generally used for the direct setting of fields.
Templatefield is more fancy. You can add dropdown to it.
----------------------------------------------------------------------------------
Boundfield column: bind data directly
Templatefield column: It can be placed into a control or other display control.
Then control the display information of the templatefield column in The create or bound event.
----------------------------------------------------------------------------------
Boundfield: the binding column. As the name implies, it is the column that needs to be bound to the data source for display. It can be displayed only when a field is bound to the datafield attribute of boundfield.
Templatefield: Template column. As the name suggests, a template is provided for the display of this column. You can define the template and add something you want, for example, adding controls to it, very flexible ..
Therefore, you can use boundfield to display data. If you want to add special requirements to the column, you can use templatefield.
Bytes ----------------------------------------------------------------------------------------------------------------------------
Templatefield can complete all boundfield functions. It is often used in practical applications.