Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8549877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:49:17+00:00 2026-06-11T13:49:17+00:00

Im new with WPF, and I,m stuck with a thing that I thought would

  • 0

Im new with WPF, and I,m stuck with a thing that I thought would be easy to solve.
I have a gridView (telerik one), and it’s ItemsSource is an ObservableCollection, it all works fine, I can see in the grid when a data is modified, when something is deleted or added, the grid is refreshed.
My problem is that when the collection is changed, the changed row goes to the last row in the grid, and I need to reorder it, I have tried to add a SortDescriptor to sort the grid when the collection is changed, but nothing happens.

//This update changes function is the one that changes the collection    
updateChanges(field, new_value);
//This is the sortDescriptor that is supposed to order the grid
UIGlobal.MainPage.gridAnalog.SortDescriptors.Add(new SortDescriptor()
{
     Member = "ColName",
     SortDirection = System.ComponentModel.ListSortDirection.Ascending
});

And this is my grid

<telerik:RadGridView>
   <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn UniqueName="ColName" Header="Name" DataMemberBinding="{Binding Key}"/>
        <telerik:GirdViewDataColumn Header="Value" DataMemberBinding="{Binding Value}"/>
   </telerik:RadGridView.Columns>
 </telerik:RadGridView>

I am tying to order it from the ColName column, but can’t get it.

Hope somebody can help me.
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:49:19+00:00Added an answer on June 11, 2026 at 1:49 pm

    This was the solution I found, may help somebody.
    I added a ColumnSortDescriptor to the grid:

    //Establish grid's ItemsSource
    grid.ItemsSource = observableDicData;    
    //Remove previous SortDescriptors
    grid.SortDescriptors.Clear();
    //Add a SortDescriptor
    ColumnSortDescriptor csd = new ColumnSortDescriptor()
    {
         //In column is the UniqueName of the grid's column I want to sort by
         Column = this.grid.Columns["NameAnalog"],
         SortDirection = ListSortDirection.Ascending
    };
    this.gridAnalog.SortDescriptors.Add(csd);
    

    And I disabled the property of UserCanSort.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to WPF. I have a ListBox that has its ItemSource set
New to wpf and through a learning curve. I have a userControl with a
I'm new to WPF. I have a WPF Window with a bunch of Labels
I have a C#/WPF application with a tabbed interface that has been behaving strangely.
I am new to WPF, have read some books about it, but now I
I have a WPF dll that contains a number of Window classes and exposes
I am fairly new to WPF, and am a bit stuck, so any help
I am new to WPF, Xaml, and am a C# beginner! I have been
I have one WrapPanel With name PageWrapPanel In Main window of my WPF application
I created new WPF Application witn two windows. MainWindow.xaml Window1.xaml Added one button in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.