i have a ActivityType field in my db. the values are [1,2,3].
each number represent type of activity.
i want to present the type in gridview as image.
i have 3 images
-
activity type 1 = avtivity_choise.jpg
-
activity type 2 = activity_text.jpg
-
activity type 3 = activity_count.jpg
i have tried to do so with template field but i need switch case statement to transfer the number to image url…
You can handle the GridView.RowDataBound event. Use something like the following:
You can also bind your image field to a database field. Refer to the following:
http://msdn.microsoft.com/en-us/library/aa479350.aspx
http://csharpdotnetfreak.blogspot.com/2009/07/display-images-gridview-from-database.html
http://www.codeproject.com/KB/aspnet/imagegalleryingridview.aspx