Try Now
More in this section
Blogs RSS feed

Working with ContentView designers (part 2): TextSetting control

by Ivan Osmak

In the previous post about ContentView designers I’ve explained how to add new settings to the ModeSettings collection to give your end users more control over how will EventsView control look like. We’ve added four TextSetting controls and I didn’t go into detail what exactly the properties of these settings do, so let’s start with that.

TextSetting control explained

In the DetailsSettings and MasterSettings collections of PresentationModeSettings control you can enter any control which derives from BaseSettingControl (yes, that means you can create your own settings – but more on that in one of the future posts). The mostly used setting is called TextSetting and it allows you to create a setting that will allow end user to dynamically set:

  • Visibility
  • Label and
  • Format

of any control in the template. Let’s examine the one of the settings controls I’ve created in the previous post:

<sfDesignSettings:TextSetting ID="TextSetting9" 

The properties of this control determine following:
  • ID – Not important, only has to be unique inside of the designer template
  • TargetID – ID of the control in a template which is controlled by this setting (in this case it is Literal with ID “Street”
  • SettingTitle – Title of the setting that end user will see when opens designer
  • AllowLabelSetting – Boolean determining whether end user will have the option to set the label for this control
  • AllowFormatSetting – Bollean determining whether end user will have the option to set formatting for this control
  • FormatType – Enumeration (DateTime|Number|String). If AllowFormatSetting is set to true, determines what kind of formatting should be allowed. DateTime will give end user drop down list with list of the date formats, Number will give end user drop down with a list of different number formats, while string will give end user textbox to enter string and “{0}” as a placeholder for the already existing text of the control (usually this is the value of the meta field)
  • AllowVisibilitySetting – Boolean determining whether end user will be able to set the visibility of the target control.
  • TargetVisibleByDefault – Boolean determining whether the control will be visible by default, without any interaction from the end user (NOTE: Setting AllowVisibilitySetting to false and TargetVisibleByDefault to true will result in an always visible control – generally used for mandated fields such as Title)

Take a look at the figure 1 to see how these properties reflect on the setting control in the designer:

Figure 1 : TextSetting control properties and their effects on the setting control in the designer

I hope I’ve made this clear enough. In the next post I’ll explain ContentSetting control and then we’ll move to the subject of creating custom settings. Leave a comment if you have any questions or suggestions.

1 comment

Leave a comment
  1. X431 IV Scanner Aug 10, 2013
    Interesting sponsor! The tagline is probably an apology for how big the sponsor is and how much space it occupies!

    Leave a comment