Autodesk Vault ProfessionalVault API

AddColumnStyleHandler Method

Autodesk.DataManagement.Client.Framework.Vault.Forms.ServicesIEntityStyleService

Registers a delegate which will provide a Style for specific properties of an Entity

Syntax

void AddColumnStyleHandler(
   System.string propDefSystemName,
   System.Action<Style,IEntity,PropertyDefinition,object> GetColumnStyleHandler,
   System.bool clearExisting
)
Sub AddColumnStyleHandler( _
   ByVal propDefSystemName As System.String, _
   ByVal GetColumnStyleHandler As System.Action(Of Style,IEntity,PropertyDefinition,Object), _
   Optional ByVal clearExisting As System.Boolean _
) 

Parameters

NameDescription
propDefSystemNameThe system name of the Property Definition to provide a style for
GetColumnStyleHandlerThe delegate which implements the function to configure the style
clearExistingTrue if the supplied delegate should replace all existing delegates for the same Property Definition, or if it should be appended to a list.

Example

public void GetColumnStyleDelegate(Currency.Style style, Entities.IEntity entity, Properties.PropertyDefinition propDef, object propertyValue)
{
   if (propDef.SystemName.Equals("XYZ") & Convert.ToInt(propertyValue) < 0)
      style.ForeColor = Color.Red;
}

See Also