ForeignKey_Edit - PopulateListControl sort RRS feed

  • Question

  • User1980140492 posted


    In the FieldTemplate "ForeignKey" it's edit version "ForeignKey_Edit" uses the PopulateListControl method to fill the dropdownlist inside the Page_Load method, but I'm wondering in which way I could make the list so that it sorts on a certain column.

    Keep in mind that it adds one line at the top "[Not Set]", which should always be the most top line.


    Thanks in advance,
    - Yannick

    Thursday, November 17, 2011 8:18 AM


  • User-330204900 posted

    you need to use the DisplyColumn attribute on the FK table liek this

    [DisplayColumn("Column to Show","Column to Sort on", true for sort descending)]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 17, 2011 8:42 AM