ASPX templates
Version 5.x > ASPX templates > Custom table listing, image field View modes: 
User avatar
Member
Member
ryans-tushaus - 2/15/2011 2:42:43 PM
   
Custom table listing, image field
I have a custom table that includes an image field. When the records are listed within CMS desk->Tools, characters are displayed for the image field. How can I get a thumbnail image to display for each record in the list?

User avatar
Certified Developer 8
Certified Developer 8
dvanbale - 2/19/2011 12:49:30 PM
   
RE:Custom table listing, image field
Dear Ryan,

The control that you see inside the Custom Table module on the CMSDesk - Tools section is a UniGrid control which looks at your custom table definition to determine what columns to show.

The Unigrid is a more intelligent version of the ASP.NET GridView control, it's essentially a wrapper around it.

When the UniGrid adds a new column to the GridView control, it can only add one type of column on to the page, which is the type BoundField, which unfortunately only shows text.

You're only other option to show a list of text with thumbnails would be to create a custom module and write your own implementation.

If you require any further help regarding either topics, please create a new topic to let us now!

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/21/2011 12:20:36 PM
   
RE:Custom table listing, image field
Hello,

Thanks for describing the situation with UniGrid, it's nicely said.

For any custom modules, you could use info from Custom tables documentation:
http://devnet.kentico.com/docs/devguide/custom_tables_available_web_parts.htm

Regards,
Zdenek

User avatar
Member
Member
ryans-tushaus - 2/21/2011 5:18:46 PM
   
RE:Custom table listing, image field
Thanks for both of your responses! I had dug into the code and reviewed the UniGrid before I posted my question. I was hoping that I had overlooked something and could accomplish the thumbnail functionality with a simple tweak. For the time being, I have decided to simply hide the image field in the list by using the built-in "Select displayed fields" functionality as programming a custom module would not be cost effective for this particular scenario.

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 2/24/2011 2:39:59 PM
   
RE:Custom table listing, image field
Hi,

Hiding the field is the fastest way, when you actually don't need it.

The usage of thumbnails in UniGrid can be however seen in our Administration interface for Avatars (in Site manager or CMS Desk).

The code for this page, utilizing OnExternalDataBound event can be seen in

~\CMSModules\Avatars\Avatar_List.aspx.cs

There you would use mechanism to get the link to the image, either as an attachment/file, or even media file... whatever you need.

Hope it will help.

Regards,
Zdenek

User avatar
Certified Developer 8
Certified Developer 8
dvanbale - 2/24/2011 3:10:49 PM
   
RE:Custom table listing, image field
Hi Zdenek,

Thanks for replying, I'm sure I can use that event for many other uses!