Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Using Uni* Controls View modes: 
User avatar
Member
Member
Peter - 12/13/2010 6:34:43 PM
   
Using Uni* Controls
Is there anyway to use the Uni Controls with objects created by Kentico (such as custom tables)? If not I will stop wasting my time. If so is it relatively straight forward (and generally how)? Thanks for any input!

User avatar
Member
Member
Jeffrey H. - 12/15/2010 10:10:10 AM
   
RE:Using Uni* Controls
Yes you can but you have to create some connector classes based on their SynchronizationInfo classes.

If there is a easier or better way I would also like to know.

User avatar
Kentico Support
Kentico Support
kentico_radekm - 12/22/2010 6:55:42 AM
   
RE:Using Uni* Controls
Hello.

New web parts documentation for version 5.5 R2 shows how to use 2 uni controls: UniGrid and UniSelector. For custom tables you can use it in the similar way, as example states. For UniGrid you can find it here, for UniSelector it is here.

Best Regards,
Radek Macalik

User avatar
Member
Member
Peter - 12/22/2010 11:09:09 AM
   
RE:Using Uni* Controls
Radek, thanks for your reply.

I can see in the example how the UniGrid might be used with Custom tables (which is great) but when I tried to use the UniSelector with a custom table the control threw an error stating that it could not find the class name object (which was assigned to the ObjectType property as specified in the ClassName field of the CMS_Class table) for the custom table data.

Can the UniSelector work with custom table objects or is it limited to built-in CMS objects?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 2/1/2011 2:29:28 PM
   
RE:Using Uni* Controls
Hello.

I'm sorry for the delay, we discussed your question with developer,
because UniSelector requires TypeInfo, but Custom tables don't have it...

Documentation about UniSelector (and UniGrid) control can be found since 5.5R2 dontrols documentation:
http://devnet.kentico.com/docs/controls/uniselector_overview.htm

To get it working with custom tables, it would be possible to modify one method from the control code:

~\CMSAdminControls\UI\UniSelector\UniSelector.ascx.cs

private DataSet GetResultSet(string id, int topN, int pageIndex, bool forceReload, int offset, int maxRecords, ref int totalRecords)

In this method, ObjectType is used to get information about column names, up to forming the where condition and query for obtaining the dataset.
You will need to create some kind of dummy ObjectType with information reflecting Custom table structure, so it could be used instead.

Hope this will be suitable for your aim.

Best Regards,
Radek Macalik

User avatar
Member
Member
knguyenca-hotmail - 4/16/2012 10:49:48 AM
   
RE:Using Uni* Controls
an example how to create a dummy object please

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 4/22/2012 11:41:21 AM
   
RE:Using Uni* Controls
Hello.

TypeInfo class is part of the source code. I don’t see details about your account on forums, so I don’t know if you have full source code license or not. Honestly, TypeInfo is not trivial object and it requires some programming skills, even you have full source code and can get an inspiration from some existing one. I would maybe recommend you to develop some custom web part instead. You can get custom table’s data easily, via our API (see Developer’s guide) or querying given table directly. The custom logic of the given web part is custom development task, so you need to do it on your own, or you can use our Consulting service.

Best Regards,
Radek Macalik