This is a migrated thread and some comments may be shown as answers.

SortMemberPath broken

1 Answer 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kravetsker
Top achievements
Rank 1
Kravetsker asked on 18 Jul 2012, 07:21 PM
Hello,

i created any GridViewComboBoxColumns on code behind with:


        private void MyGridView_AutoGeneratingColumn(object sender, Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs e)
        {
            DirInfoPropertyDescriptor propertyDecriptor = e.ItemPropertyInfo.Descriptor as DirInfoPropertyDescriptor;
            GridViewDataColumn datacolumn = e.Column as GridViewDataColumn;
            if (datacolumn != null)
            {
                IList<FieldDropDownItem> dropdownItems = DirInfo.FieldsDropdownItemsCache[propertyDecriptor.Name];
                if(dropdownItems.Count != 0)
                {
                    GridViewComboBoxColumn comboColumn = new GridViewComboBoxColumn();
                    comboColumn.Header = datacolumn.Header;
                    comboColumn.DataMemberBinding = datacolumn.DataMemberBinding;
                    comboColumn.SelectedValueMemberPath = "Id";
                    comboColumn.DisplayMemberPath = "Description";
                    comboColumn.SortMemberPath = "Description";
                    comboColumn.ItemsSource = dropdownItems;
                    (sender as RadGridView).Columns.Add(comboColumn);
                    e.Cancel = true;
                }                    
            }           
        }

It works nice: i can see and edit my dropdown values, but i cant sort.
After sorting my grid is empty, see screenshot

1 Answer, 1 is accepted

Sort by
0
Kravetsker
Top achievements
Rank 1
answered on 18 Jul 2012, 07:35 PM
Sorry, i found now the solution.
I cant bind SortMemberPath on  comboColumn.ItemsSource, but on MyGridView Columns


Tags
GridView
Asked by
Kravetsker
Top achievements
Rank 1
Answers by
Kravetsker
Top achievements
Rank 1
Share this question
or