Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Display two fields in a select list label?

$
0
0
Just make sure to populate the options with the Return Value of a method you call yourself. The easiest is like this

In your form markup, use this as Options
<ff:StaticMethodCall type="Your.Helper.Type" method="GetListValues" />
And then have this code that you're calling.
public class Your.Helper.Type 
{
   public static Dictionary<string, string> GetListValues() 
   {
      using (var data = new DataConnection()) 
      {
         return data.Get<IYourType>().ToDictionary(e => e.Id, e => e.FirstName +" "+ e.LastName);
      }
   }
}

Viewing all articles
Browse latest Browse all 2540

Trending Articles