Completed
Last Updated: 17 Jul 2015 09:55 by ADMIN
ADMIN
Stefan
Created on: 09 Jul 2015 12:52
Category: DropDownList/ListControl
Type: Bug Report
0
FIX. RadListControl - the ListElement.ItemsSortComparer is not taken into consideration when sorting
Workaround, set the custom comparer in the SortStyleChanged event:

  void radListControl1_SortStyleChanged(object sender, SortStyleChangedEventArgs args)
        {
            radListControl1.ListElement.ItemsSortComparer = new MyComparer();
        }

        class MyComparer : IComparer<RadListDataItem>
        {
            public int Compare(RadListDataItem x, RadListDataItem y)
            {
                return ((Student)x.DataBoundItem).Id.CompareTo(((Student)y.DataBoundItem).Id);
            }
        }

       private void radButton1_Click(object sender, EventArgs e)
        {
            radListControl1.SortStyle = SortStyle.Ascending;
        }
0 comments