Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Is there a working example where the Uniselector is used with SelectionMode = Multiple? View modes: 
User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 7/20/2012 3:09:54 PM
   
Is there a working example where the Uniselector is used with SelectionMode = Multiple?
I am trying to create a custom form control that will allow the selection of multiple documents to store in a field for Web parts. This form control type exists in the Umbraco CMS, but not in Kentico, which I find quite annoying and unbelievable.

I want something that works similar to the ClassNames selector but I want it to select documents like the Document selector does and I want it to display the selected documents in a UniGrid.

After reading the documentation here, I understand that the uniselector control can be configured to display selected items in a unigrid if I set the selectionmode to "multiple"

To test out the settings, I temporarily changed the SelectionMode of the ClassNames form control to "Multiple" and set the GridName property to the location of an xml file

I don't have a complete understanding of how to configure the UniGrid with the xml file, so I didn't put anything in the columns, hoping that it would autogenerate them.

When I loaded a wep part configuration window, I immediately got the error "The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases." I also get this error when I omit the GridName property.

I don't have the time to learn everything about the UniGrid and the UniSelector by messing around with them, so I am hoping that someone can help me.

Does anyone have an example or know where I can find an example where a UniSelector is used with SelectionMode = Multiple?

Also, If any of you Kentico devs out there who know the UniGrid and UniSelector really well and want to quickly whip together a custom form control that allows selection of multiple documents and stores their document ids in a delimited list like the classnames form control, please do so and send it my way.

Thanks!

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/22/2012 6:25:57 PM
   
RE:Is there a working example where the Uniselector is used with SelectionMode = Multiple?
Hi,

You can see example in \CMSModules\DocumentLibrary\Controls\DocumentLibrary.ascx.cs, where UniGrid with GridName="~/CMSModules/DocumentLibrary/Controls/DocumentLibrary.xml" property is defined.

An uniselector with mode Multiple is used for example in document type definition, Sites tab. This one uses control defined in:
~CMSModules/AdminControls/Controls/Class/ClassSites.ascx

Best regards,
Ivana Tomanickova

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 7/23/2012 10:26:19 AM
   
RE:Is there a working example where the Uniselector is used with SelectionMode = Multiple?
Can you explain to me the difference in the UniGrid column property Source and ExternalSourceName?

I really need an example where I am binding the grid to a custom generic list or dataset.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/2/2012 4:42:03 PM
   
RE:Is there a working example where the Uniselector is used with SelectionMode = Multiple?
Hi,

if you need to only bind unigrid with dataset you just need to call in your code behind Databind method of the UniGrid class. You may need to also call ReloadData(true) after that.

yourUniGrid.DataSource = <DataSet>;
yourUniGrid.DataBind();

Best regards,
Ivana Tomanickova