Page Tree


Software Knowledgebases

FactoryStudio 9.1

FactoryStudio 8.1

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Then, you can use that given name (2) to get control of the element and change its properties. The below is an example. 

Code Block
TDataGridWindow grid = CurrentDisplay.GetDataGrid("Employees"); 
grid.GridControl.SetColumnSparkline("Orders", this.SparklineCollectionDelegate, style);
// SetColumnSparkline parameters - fieldName (string)
//	               - populateCallback (SparklineCollectionDelegate)
//	               - style (string)

...

Note

A delegate will only call a method that agrees with its signature and return type. A method can be either a static method associated with a class, or it can be an instance method associated with an object. 

Below is a callback. The system will always look for a code EXACTLY like this one to create the Sparkline. So if you want to use this feature, you MUST have this code on your code behind.

Code Block
Dictionary<int, ArgumentValue[]> mapEmployeeToOrders = null;
private ArgumentValue[] SparklineCollectionDelegate(string fieldName, System.Data.DataRow row)
{
ArgumentValue[] sourceCollection;
int  emplID  =  TK.To< int>(row["EmployeeID"]);
if (!this.mapEmployeeToOrders.TryGetValue(emplID, out sourceCollection)) 
       sourceCollection = new ArgumentValue[0];
return sourceCollection;
}

...