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

  • Home
  • SEARCH
  • 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 8394391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:02:55+00:00 2026-06-09T20:02:55+00:00

this is my wpf file i want sort a GridView when a column header

  • 0

this is my wpf file i want sort a GridView when a column header is clicked
i try this make <GridView AllowsColumnReorder="true"> but not working

sorry for my bad English

            <ListView Name="deviceListBox"
                  Width="630"
                  Height="282"
                  HorizontalAlignment="Center"
                  VerticalAlignment="Center"
                  ItemsSource="{Binding Items}"
                  SelectionChanged="deviceListBox_SelectionChanged"
                  SelectionMode="Single">
            <ListView.View>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn>
                            <GridViewColumn.HeaderTemplate>
                                <DataTemplate>
                                    <Label Width="15"
                                           Height="25"
                                           Margin="10,0,0,0"
                                           HorizontalAlignment="center"
                                           VerticalAlignment="Center" />
                                </DataTemplate>
                            </GridViewColumn.HeaderTemplate>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <controls:PresenceIndicator Width="35"
                        Height="30"
                        Margin="7,0,0,0"
                        HorizontalAlignment="center"
                        VerticalAlignment="Center"
                        PhotoDisplayMode="Large"
                        SingleClickAction="ShowContactDetails"
                        Source="{Binding Path=SipURI}" />
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn>
                            <GridViewColumn.HeaderTemplate>
                                <DataTemplate>
                                    <Label Width="95"
                                           Height="25"
                                           Margin="10,0,0,0"
                                           HorizontalAlignment="Left"
                                           VerticalAlignment="Center"
                                           Content="Username"
                                           Foreground="Black" />
                                </DataTemplate>
                            </GridViewColumn.HeaderTemplate>
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <Grid>
                                        <Label Height="30"
                                               Margin="7,0,0,0"
                                               HorizontalAlignment="left"
                                               VerticalAlignment="Center"
                                               Content="{Binding Path=Username}"
                                               Foreground="Black" />
                                    </Grid>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn>
  • 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-09T20:02:57+00:00Added an answer on June 9, 2026 at 8:02 pm

    I think ListView doest not support sorting by default. Yo need to create attached dependency property to handle the sorting.

    refer – Automatically sort a GridView when a column header is clicked

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

Sidebar

Related Questions

This is my wpf file. I want the GridView to support multiple selections. <ListView
I'm not familiar with wpf or C# language, but I want to generate xaml
I have a grid in a XAML file in a WPF project. This MainGrid
being new to WPF this is a complex problem for me. What i want
I have a datagrid in a WPF populated from a csv file. This is
This question is kind of lengthy but I try to provide you with the
Im having some problems with binding in wpf/xaml. Have this simple file: <Window x:Class=test.Window1
I have a WPF Control and I want to drop a specific file from
I have this XML file: <?xml version=1.0 encoding=utf-8?> <Wpf> <wpfctrl id=NavBtnTemplate>#FFCFDEFF</wpfctrl> </Wpf> and i
In my C# WPF application, I want to incorporate something like 'last used file

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.