//get the values from the dropdown selecteditem
string fieldName = "OrderId";
string containingObjectName = "OrderEntity";
IRelationPredicateBucket bucket = new RelationPredicateBucket();
PredicateExpression filter = new PredicateExpression();
IPredicateExpression predicateExpression = new PredicateExpression();
EntityField2 ent = EntityFieldFactory.Create(containingObjectName, fieldName);
Predicate predicate = ent == valueTextBox;
predicateExpression.Add(predicate);
filter.Add(predicateExpression);
bucket.PredicateExpression.Add(filter);
which could be simpifilied to this
//get the values from the dropdown selecteditem
string fieldName = "OrderId";
string containingObjectName = "OrderEntity";
EntityField2 ent = EntityFieldFactory.Create(containingObjectName, fieldName);
IRelationPredicateBucket bucket = new RelationPredicateBucket(ent == valueTextBox);