What is the Difference between Templatefield and Boundfield in Gridview?

 Posted by vishalneeraj-24503 on 1/14/2014 | Category: ASP.NET Interview questions | Views: 4479 | Points: 40
Answer:

When we bind GridView with some columns like ID,Name,City etc.,these columns will display as BoundFields.
Bound means which Columns we bound to Gridview or any control.

Suppose,we want to make some changes in existing display i.e. instead of Label control if we want to display any data in TextBox or Button then we can use Templatefield.

In short,BoundField is only used for display record i.e. it's Read-only fields means we can only view data but can not Edit
whereas TemplateField is used for both viewing as well as editing records.With the help of ItemTemplate and EditItemTemplate we can view as well as edit data.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response