This project is read-only.

Populating Dropdowns in the User Interface with Text Values, not IDs????

Sep 19, 2012 at 1:10 PM

Hi,

How does one ensure that any navigation(foreign keys) properties are presented as dropdowns in the UI with the Text value representing the "Name" field in the Look Up Object/Table rather than the current ID?

Many thanks,

Ed

Sep 19, 2012 at 2:18 PM

What should be presented in the drop-downs is the 'title' of the objects.  If that type of object does not have a title, then it will just use the ToString() for the object  -  which may be what you are seeing.

Just annotate that Name property on the associated type with [Title].

Sep 19, 2012 at 2:46 PM
Edited Sep 19, 2012 at 3:23 PM

Hi,

Thanks, I am getting there, but not quite there. I believe I also need to use the [Bounded] attribute on the class to get the drop down.

The screen thus far is:

ScreenShot

The first bit of the Customer Class is:

+++

 

    [Bounded]
    public partial class Customer
    {
   
        #region Primitive Properties
        #region Id (Int32)
    [MemberOrder(100)]
        public virtual int  Id {get; set;}

        #endregion
        #region Name (String)
    [MemberOrder(110),Title]
        public virtual string  Name {get; set;}

 

+++

I just need to remove the CustomerID (auto populate from DropDown) and the ID(Autopopulate on Save to the DB via the Identity DB feature).

Thanks for any help, really appreciated.

Sep 19, 2012 at 3:54 PM

Now discovering the [disabled] and [hidden] attributes !!! :)

Many thanks.