Home Forums WPF controls Xceed DataGrid for WPF Column sorting

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25761 |

    Howdy – I’m trying to figure out how I can allow a grid to only have one column sortable. My grid is two columns and X rows. Column0 of the grid is a name field, and Column1 is a value field, but the values are not all of the same type.

    Imported from legacy forums. Posted by Bill (had 2271 views)

    User (Old forums)
    Member
    Post count: 23064

    If you add a template for each ColumnManagerRow, there is “AllowSort” property that you may use for this.

    Imported from legacy forums. Posted by nat (had 306 views)

    User (Old forums)
    Member
    Post count: 23064

    Yes, but that allowed sorting on both columns that I had.

    My “solution” for this was to disable the Value column:

    <xcdg:TableView.FixedHeaders>
    <xcdg:ClearHeaderFooters/>
    <DataTemplate>
    <xcdg:ColumnManagerRow AllowColumnReorder=”False” AllowSort=”True>
    <xcdg:ColumnManagerCell FieldName=”Value” IsEnabled=”False”/>

    —- lots of closing tags

    It seems like there should be an easier way to do this. Also- It would be nice to be able to access this stuff from the c# code, instead of XAML. As of yet I have not figured out how to do that.

    Imported from legacy forums. Posted by Bill (had 5101 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.