Working with Value Lists

  • Updated

Prerequisites: A valid Entity and RuleSession
Namespacesxxx: InRule.Runtime, InRule.Repository
Classes: ValueListItem, RuleApplicationDef, ListItemDefCollection

Populating a combobox from a value list

// Retrieve a value list that is associated to a field
ValueList valueList = entity.Fields["State"].AssociatedValueList;

foreach (ValueListItem valueListItem in valueList)
  // Add the list item value to the combobox
   comboBox.DisplayMemberPath = "Value";

Populating a combobox from a standalone value list

// Get value list using the session’s DataManager
ValueList myList = ruleSession.Data.GetValueList("StandAloneValueList");

// Tell combo box what field to display to the end user
comboBox.DisplayMemberPath = "DisplayText";

// Add the item to the combo box
foreach (ValueListItem item in myList)

Was this article helpful?

0 out of 0 found this helpful



Please sign in to leave a comment.