 | CTInterface.OnCustomListUpdate Event |
Invoked for each Custom-type lookuplist at CUSTOMTOOLS start up and
when 'Run' is clicked at Options for the Custom-type lookuplist in question.
Allows full control over the lookuplist content.
Namespace: ATR.CT.CTInterfaceAssembly: CTInterface (in CTInterface.dll) Version: 25.0
Syntax
Example
This sample shows how you can use
CustomLookup class to easily
control content of a Custom-type lookuplist.
using System;
using System.Collections.Generic;
using System.Text;
using ATR.CT.CTInterface;
using CTEngineLib;
namespace ExportScripts
{
public class CustomLookupExample : ATR.CT.CTInterface.CustomLookup
{
private CTInterface moCTInterface;
private List<LookupItem> moLookupItems;
public CustomLookupExample(CTInterface ctInterface)
{
moCTInterface = ctInterface;
moCTInterface.OnCustomListUpdate += new EventHandler<CTInterface.CustomListUpdateArgs>(OnCustomListUpdate);
}
private void OnCustomListUpdate(object sender, CTInterface.CustomListUpdateArgs e)
{
ICTLookupList oList = e.LookupList;
if (String.Compare(oList.Name, "List1", true) != 0)
return;
moLookupItems = new List<LookupItem>();
LookupItem item1 = new LookupItem();
item1.Value = "Value1";
moLookupItems.Add(item1);
LookupItem item2 = new LookupItem("Value2");
moLookupItems.Add(item2);
item1.SetKey(1, "Key1 for Value1");
item2.SetKey(7, "Key7 for Value2");
LookupItem childItem1 = new LookupItem("ChildValue1");
item1.AddChild(childItem1);
moLookupItems.Add(childItem1);
LookupItem childItem2 = new LookupItem("ChildValue2", item1);
moLookupItems.Add(childItem2);
moLookupItems.Add(new LookupItem("ChildValue3", item2));
childItem2.SortOrder = 1;
childItem1.SortOrder = 2;
e.RetXml = CreateXMLString(moLookupItems);
}
}
}
Revision HistoryDate | Version | Description |
---|
- | 2013 SP4 | First Release |
See Also