The recommended approach is return the user's first name as part of the original query and just use a BoundColumn
. If you need to modify data before displaying, then yes you can use a TemplateColumn
and the OnItemDataBound
event to manipulate your data.
Running queries OnItemDataBound
is not something I would ever encourage. So if your grid will show 100 records at once, you want to run 100 extra queries per page load? This is something that if you implement, could possibly run within reason during testing. Once under load though, you'll see have hundreds of extra queries running isn't a good idea... it can just be solved by fixing the original query or maybe making a denormalized table depending on your DB structure and the complexity of your query.
When I ran into similar issue, I went the denormalized table route.