Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Adding delete functionality to MediaGallery webpart View modes: 
User avatar
Member
Member
aconde-sequenom - 10/16/2009 6:10:34 PM
   
Adding delete functionality to MediaGallery webpart
How do I enable the ability to delete files using the MediaGallery webpart?

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 10/22/2009 6:01:32 AM
   
RE:Adding delete functionality to MediaGallery webpart
Hi,

This is not possible by default. However, you can create your custom control for this purpose. You can then use this control in media gallery web part transformation. In code behind of this control you can use Delete methods of CMS.MediaLibrary.MediaFileInfoProvider class to delete media library file.

Best Regards,
Miroslav Remias.

User avatar
Member
Member
Yalın - 12/16/2009 4:23:41 PM
   
RE:Adding delete functionality to MediaGallery webpart
Can you please complete the answer by giving an example as to how to use the delete function of the class please?

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 12/18/2009 8:12:32 AM
   
RE:Adding delete functionality to MediaGallery webpart
Hi,

You can use for example following method to delete your media library file:

CMS.MediaLibrary.MediaFileInfoProvider.DeleteMediaFileInfo(int mediaFileId)

Best regards,
Miroslav Remias.