Monday, August 28, 2017

// // Leave a Comment

How to Add Template Column in Gridview


How to Add Template Column in Gridview

In this article I am going to explain, how to add template column in Gridview. As previous articles what I have explained as you have to drag and drop Gridview control to form. and bind SQL table with data source.


As showing in above image click on Gridview right hand side arrow, then pop menu will display, in the next step click on Add new Column.



and choose a field type from the dropdown list as TemplateField and input header in Header text box.
Press OK for apply the changes, new Template column will displayed in Grdview.

But still this Template column not bind with data field.

Bind data with Template column

Right click on the Gridview right hand side arrow, then menu will displayed and you have to select Edit Template.



Then you can see a sub menu with template column. click on the Template column.



Drag and drop Label to inside of Item Template and bind data



Clink on Label and Label Task menu will display, in this menu click on Edit binding, then above screen will display. Select the field name from Field binding and press OK.


Open with browser and you can see the bind data with template column.














0 comments:

Post a Comment