Technical support This forum is closed.
Version 1.x > Technical support > CMSViewer data... accessible? View modes: 
User avatar
Member
Member
MP211 - 2/23/2006 12:04:51 AM
   
CMSViewer data... accessible?
Is there a way to programmatically access the datasource or collection retrieved by the CMSViewer in a code-behind?

There doesn't seem to be an accessible DataSource property, and it's DataBinding event doesn't seem to pass this information via it's event arguments in the way typical databinding would--thought it is clear that databinding is being used due to the working databinding expressions we have in our ASCX transformation that is applied to it.

I am trying to access this information in any way possible, be it via properties or an event model... any input? Am I simply missing something?

Thanks much, in advance.

User avatar
Guest
admin - 2/23/2006 7:39:24 AM
   
Re: CMSViewer data... accessible?
Hello,

you will need to use Kentico CMS API to retrive the data, unfortunately, they are not available as a property of CMS Controls.

You can do something like this:

TreeNode doc = Functions.GetCurrentDocument();

or

DataSet ds = Functions.GetTreeProvider().SelectNodes("/%", TreePathTypeEnum.AliasPath)

Please let me know if you need any further details.

Best Regards,