Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why use templates columns in datagrid?

Status
Not open for further replies.

dbsquared

Programmer
Nov 7, 2002
175
US
I see a lot of posts in here that reference converting the columns in a datagrid to templates.
So I have a couple of questions:

1) what is the benefit to using the template column over the default column layout?
2) do the template columns react to data the same as the default column setup?
3) once using the template must you use special commands?

Thanks I just want to know if using hte template is easier/better than the default datagrid.
Thanks

To go where no programmer has gone before.
 
If you need to use any other control than Label for view and Textbox for edit then I believe you need to use a Template Column. Other than that I use the standard.

Hope this helps.

Hope everyone is having a great day!

Thanks - Jennifer
 
Jennifer is correct. Also, if you use template columns and want to access the data, you have to use the grid's ItemDataBound event to loop through the rows of the grid. Then do a findcontrol in the cell to access the controls properties.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top