MultiRow Windows Forms > Developer's Guide > Using MultiRow > Advanced Designer Features > Adjust Character Size with Placeholders |
The designer provides a DesignTimeValue property that you can use to set the characters that are displayed only at design time (Designtime Placeholder). By using this property at design time, you can display the value for estimating the cell size, and hide this value at run time, without the need for code. For example, using a fixed width font and a fixed number of characters, you can estimate the size of the string using dummy values like "999-9999" or "XXXXXXX".
DesignTimeValue is a special property that can only be used at design time and cannot be used at runtime. Use the Cell.Value property to display the same value at design time as well as runtime.
Since the DesignTimeValue property is mainly used to estimate the width of the string, it is recommended to use it with fixed width fonts.
The following steps explain how to specify the fixed width font and dummy string.
The specification of the DesignTimeValue property is same as the Value property of that cell. For example, in the date type cell (DateTimePickerCell), since the Cell.Value property has a Date type value, the type of the DesignTimeValue property is also Date type.
The DesignTimeValue property is not a hidden property of the cell, but is design information. The value of the DesignTimeValue property is stored in the Template.resx file, and is not output to Template.Designer.vb (or Template.Designer.cs).
Related topics are Locking Cells in the Designer and Create Template from Table.