• Webseitenerstellung und -hosting
  • .NET Anwendungsentwicklung
  • softwaregesteuerte Prozessoptimierung
  • .NET

    Programmierung

  • WebseitenErstellung

    undHosting

  • softwaregesteuerte

    Prozessoptimierung

  • Konzeption

    und Beratung

%PM, %14. %545 %2016 %12:%Nov

WPF Datagrid Sortierung DataGridTemplateColumn

geschrieben von
Artikel bewerten
(0 Stimmen)

Nachdem die banale Sortierung eines Datagrids normal keine große Sache sein sollte hier dennoch meine Lösung da es leider defakto nicht so ist. Füllt man nämlich die Daten im Code behind via Itemssource und hat zusätzlich noch eine DataGridTemplateColumn funktioniert die Sortierung nicht! Außer man geht genau so vor wie ich es hier beschreibe:

 

1. Festlegen der Grideigenschaft CanUserSortColumns auf true
2. Festlegen des SortMemberPathin den Eigenschaften des DataGridTemplateColumn im XAML
3. Setzen der ItemsSource="{Binding}" (Dummy) in den Grideigenschaften (!!!)
4. Füllen des Grids via Datacontext und konvertierung dieser als Liste!!!!

Klingt komisch ist aber so. Hier also als Beispiel:

DataGrid Name="grdLast" AutoGenerateColumns="False" AlternationCount="2" CanUserSortColumns="True" SelectedValuePath="aktivitaets_id" ItemsSource="{Binding}" IsReadOnly="True" SelectionMode="Single"

DataGridTemplateColumn Header="Datum" MinWidth="120" SortMemberPath="datum"

grdLast.DataContext = (From o In db.xxx).ToList
Gelesen 21251 mal

81 Kommentare

  • Kommentar-Link 토토사이트 %PM, %20. %853 %2023 %19:%Aug gepostet von 토토사이트

    Attractive section of content. I just stumbled upon your web site and in accession capital to assert that I acquire actually enjoyed
    account your blog posts. Anyway I'll be subscribing to your augment and even I achievement you access consistently rapidly.

  • Kommentar-Link 먹튀검증 %PM, %19. %570 %2023 %12:%Aug gepostet von 먹튀검증

    Yesterday, while I was at work, my cousin stole my iphone
    and tested to see if it can survive a 40 foot drop, just so she
    can be a youtube sensation. My iPad is now broken and she has 83 views.

    I know this is entirely off topic but I had to share it with someone!

  • Kommentar-Link 소액결제현금화 %AM, %19. %362 %2023 %07:%Aug gepostet von 소액결제현금화

    We are a group of volunteers and opening a new scheme in our
    community. Your website offered us with valuable info to work on. You have done an impressive job and
    our entire community will be thankful to you.

  • Kommentar-Link 소액결제현금화 %PM, %17. %835 %2023 %19:%Aug gepostet von 소액결제현금화

    Thanks for your marvelous posting! I really enjoyed
    reading it, you can be a great author. I will be sure to bookmark your blog and may come back later in life.
    I want to encourage you to continue your great work,
    have a nice weekend!

  • Kommentar-Link 토토사이트 %PM, %16. %732 %2023 %16:%Aug gepostet von 토토사이트

    I all the time used to read article in news papers but now as I am
    a user of web therefore from now I am using net
    for content, thanks to web.

  • Kommentar-Link 카지노사이트 %PM, %15. %807 %2023 %18:%Aug gepostet von 카지노사이트

    I don't even know how I ended up here, but I thought
    this post was great. I do not know who you are but definitely you're going to a famous blogger if you are not already ;) Cheers!

  • Kommentar-Link 카지노사이트 %AM, %15. %047 %2023 %00:%Aug gepostet von 카지노사이트

    We are a gaggle of volunteers and opening a new scheme in our community.
    Your site provided us with helpful info to work on. You've performed
    a formidable process and our entire neighborhood shall be thankful to you.

  • Kommentar-Link 슬롯사이트 %PM, %14. %557 %2023 %12:%Aug gepostet von 슬롯사이트

    Nice post. I was checking constantly this blog and I'm impressed!
    Extremely useful info specially the last part :) I care
    for such info a lot. I was seeking this
    particular info for a long time. Thank you and good luck.

  • Kommentar-Link 온라인슬롯 %AM, %14. %124 %2023 %01:%Aug gepostet von 온라인슬롯

    A motivating discussion is definitely worth comment.
    I think that you should publish more on this issue, it
    may not be a taboo matter but usually people do not
    speak about these topics. To the next! Cheers!!

  • Kommentar-Link Wnxcez %PM, %26. %881 %2023 %20:%Mai gepostet von Wnxcez

    best male ed pills http://ordergnonline.com/ h

Schreibe einen Kommentar

Bitte achten Sie darauf, alle Felder mit Stern * zu füllen. HTML-Code ist nicht erlaubt.