We are building a smartforms control and we want to extend the datasource property where we can attach a SmartObject. We want to use the filter / lookup functionality but it is not available. We think we are missing some settings in the xml definition file.
We want to have the functions for filtering which are in the standard picker control.
Does anyone have code examples or a sample project which we can use?
Extending custom SmartForm control with SmartObject filter properties like picker control
Hi,
This document covers how you can use Custom Controls to extend the functionality and look of standard K2 smartforms
http://help.k2.com/helppages/K2smartforms1.02DevRef/webframe.html#K2_smartforms_Custom_Controls.html
This documemt covers what can be done data sources in k2, look at the limitations and what is possible and see how you can work around configuring data sources: http://help.k2.com/helppages/K2smartforms1.0.5/SF_-_ViewControls_-_Drop-Down_List.html
Have a look at these and see if they help
Kind regards
Nelly
This is somewhat copypasta, but I think it's a sstart. Posting here so that it may help others down the line.
1. In your Definition.xml file, add the following section:
<Prop ID="DataSourceType" friendlyname="Type" type="complex" serverControlType="property" category="Data Source" InitializeServerControl="initializeAssociationPropertyConfig" ClearServerControl="clearComplexPropertyConfig" ServerControl="SourceCode.Forms.Controls.Web.PropertyConfiguration.AssociationPropertyConfig, SourceCode.Forms.Controls.Web" />
<Prop ID="FixedListItems" friendlyname="Items" type="string" serverControlType="property" category="Data Source" ReadOnly="true" />
<Prop ID="AssociationSO" friendlyname="SmartObject" type="string" serverControlType="smartobject" category="Data Source" ReadOnly="true" />
<Prop ID="AssociationMethod" friendlyname="Method" type="string" serverControlType="listmethod" category="Data Source" ReadOnly="true" />
<Prop ID="ValueProperty" friendlyname="Value" type="string" serverControlType="property" category="Data Source" ReadOnly="true" />
<Prop ID="DisplayTemplate" friendlyname="Display" type="string" serverControlType="property" category="Data Source" ReadOnly="true" />
2. In your control.cs file, add the following section:
public string DataSourceType{
get
{
return this.DataSourceType;
}
set
{
this.DataSourceType = value;
}
}
You will want to repeat this "DataSourceType" function for each property needed.
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.