Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...GetDataType similar to the one while adding profile propertyGetDataType similar to the one while adding profile property
Previous
 
Next
New Post
11/24/2008 6:33 AM
 

Hi All,

       I need to know how can i get the datatypes similar to the ones which we get while adding profile properties in DNN. Can anybody help regarding this. I too need to retrieve that same datatypes(like char etc) in my module. so anyhelp would be greatly appreciated. please if anybody knows it or have implemented it before send me a sample code of how i can retrieve them and bind it to my combobox

Thanks,

SandeepM

    

 
New Post
11/24/2008 10:49 PM
 

The profile property definition data types are stored in Host --> Lists (DNN Lists table) with a list name of "DataType" and no parent key. The collection of data types may be obtained and bound to a drop down list (ddlDataType in the example below) as follows (using the EntryID field and Value field of each list entry for the drop down list items value and text properties respectively):

Dim objListController As New DotNetNuke.Common.Lists.ListController
Dim dataTypeList As DotNetNuke.Common.Lists.ListEntryInfoCollection
dataTypeList = objListController.GetListEntryInfoCollection("DataType")
With ddlDataType
   .DataTextField = "Value"
   .DataValueField = "EntryID"     'or "Text" - see below comment
   .DataSource = dataTypeList
   .DataBind()
End With

The Text field of the ListEntryItem provides a string representing the fully qualified Namespace.Classname, AssemblyName which may be of more help to you rather than the EntryID if you are thinking of dynamically creating instances of the appropriate DNN EditorControl for a selected data type (using reflection and the Activator.CreateInstance method). For example for the "Integer" data type, the Text field is "DotNetNuke.UI.WebControls.IntegerEditControl, DotNetNuke".

Note that outside of their use in setting the data type for profile property definitions, the data type values are meaningless. Therefore, rather than trying to "reinvent the wheel" to make use of the DataType list,  I would look closely at the source code not only for the profile property definitions, but also for the individual property editor controls, the CollectionEditorControl, PropertyEditorControl, SettingsEditorControl, ProfileEditorControl, etc.

I am currently extending my ContentDejour DNN Forge project to serve up its rotating content based upon any Profile Property (standard or custom) of the logged in user and spent quite a bit of time studying the source code to understand this entire topic - and have been very impressed with the capabilities and possibilities for further extension the property editor controls provide to the developer. Kudos to Charles Nurse for his excellent work on this!

For more information, here's a helpful set of blogs on Charles' DNN Developer Zone site:

http://dnndevcenter.com/Library/tabid/126/SectionId/2/Default.aspx


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...GetDataType similar to the one while adding profile propertyGetDataType similar to the one while adding profile property


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out