5
Vote

Sort order on drop down lists

description

I've created a series of drop downs. The parent on contains ~150 items. These items are not sorted alphabetically as they are in the source list. Is there some setting or is this an issue w/ the code?

comments

ofergal wrote Oct 20, 2010 at 12:24 PM

In the file X method CreateChildControls()
After:
if (!listNotFound)
        {
            // populate it with the values from the central master page list.
            DataView dv = new DataView(list.Items.GetDataTable());
Add a line
            dv.Sort = dv.Table.Columns[0].ColumnName;
That should take care of the sort order of the parent.

mauriciosa wrote Nov 19, 2011 at 9:57 AM

Hi there. Can someone please explain how to implement this? thanks