c# - Is it possible to define our own asp controls in bound field like Template field? -


this question may repetition.but haven't got answer question : difference between bound field , template field?.i have asp gridview.i had found bound field used bind data directly using header text , datafield out using controls.

template field

 public void instantiatein(system.web.ui.control container)     {    //code     } 

bound field

protected override void initializedatacell(datacontrolfieldcell cell, datacontrolrowstate rowstate)     {     //code     } 

templatefield more flexible boundfield.

both of them add 1 column gridview, templatefield allow customize column.

by example, can add validation controls in edit template validate textbox control. can add complex tables column.

you dont have flexibility in boundcolumn

summary :

if displaying data should using boundfield.

if requirement include editing data should use template field.

templatefield

represents field displays custom content in data-bound control.

boundfield

represents field displayed text in data-bound control.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -