Hi
could you give me few examples on how to set formats? and what is the right datatype that the FeatureSourceColumn should implement for the previous formats?
thanks in advance.
jm
Style.TextFormat & style.NumericFormat && style.DateFormat
Hi JM,
The TypeName of the FeatureSourceColumn is a freeform, its format is depended on the FeatureSource or the data engine you are using, for example, if you are using the SQL Server, the TypeName of the "TextFormat" is "varchar" or "nvarchar", please get details at technet.microsoft.com/en-us/library/ms187752.aspx, if the data Engine is ESRI ShapeFile, maybe a bit different for "TextFormat", it should be "String". The format should be the one which can be read by its engine.
Hope it helps.
Thanks,
Johnny
Hi Johnny,
thanks for your inputs. However, I would like to know how the format works in relationship with an in memory feature layer and the way that the map engine is rendering the data. For instance does this code will be render the data on the map based on the style/format? :
TextStyle style =
TextStyles.CreateSimpleTextStyle(p.Name.ToString(CultureInfo.InvariantCulture).ToUpperInvariant(),
"Arial",
7, DrawingFontStyles.Bold, GeoColor.StandardColors.Blue, 0, offY -= 6);
style.TextFormat = "{0,48}";
style.NumericFormat = "D";
style.DateFormat = "{0:MM/dd/yy H:mm:ss zzz}";
style.AllowLineCarriage = false;
style.BestPlacement = false;
style.FittingLineInScreen = true;
style.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;
thanks a lot.
jm
Hi JM,
Thanks for the further information. Actually, there is not a direct relationship between the datatype of the FeatureSourceColumn and the three xxxformat. In general, we only set one of the formats for one TextStyle, for example, if we know the value of specified column is a date type, then we only need to set the DateFormat for the TextStyle in case of the value is applied to the other format.
Here is a sequence to choose which format is used if all of the three formats are specified on a TextStyle.
string columnValue = …
if (!string.IsNullOrEmpty(numericFormat))
{
}
else if (!string.IsNullOrEmpty(dateFormat))
{
}
else if (!string.IsNullOrEmpty(textFormat))
{
}
Best regards,
Johnny