Veröffentlicht 2. Januar 20205 j Hallo Ich möchte mehrere Objekte der Klasse Schüler (ID, Vorname, Nachname, Wohnort) in einer GridView darstellen. Die Daten kommen aus einer SQLite Datenbank. Leider verstehe ich nicht ganz wie das Data Binding funktioniert. Ich finde die Tutorials dazu sehr unverständlich und hoffe jemand kann mir das Thema an einem einfachen Code Beispiel erklären. Frohes neues Jahr! Bearbeitet 2. Januar 20205 j von Starschüler Rechtschreibung verbessert
4. Januar 20205 j Grüße dich, was genau verstehst du daran nicht? Was hat du bislang probiert? Ein wenig mehr Input wäre super um dir helfen zu können. Zitat In general, to display a collection, you bind the ItemsSource of an items control (such as ListView or GridView) directly to a property that returns a collection. If that's a flat collection of items then you don't need to do anything special. But if it's a collection of group objects (as it is when binding to grouped data) then you need the services of an intermediary object called a CollectionViewSource which sits between the items control and the binding source. You bind the CollectionViewSource to the property that returns grouped data, and you bind the items control to the CollectionViewSource. An extra value-add of a CollectionViewSource is that it keeps track of the current item, so you can keep more than one items control in sync by binding them all to the same CollectionViewSource. You can also access the current item programmatically through the ICollectionView.CurrentItem property of the object returned by the CollectionViewSource.View property. https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth Bearbeitet 4. Januar 20205 j von r4phi
8. Januar 20205 j Am 4.1.2020 um 11:51 schrieb r4phi: Grüße dich, was genau verstehst du daran nicht? Was hat du bislang probiert? Ein wenig mehr Input wäre super um dir helfen zu können. https://docs.microsoft.com/en-us/windows/uwp/data-binding/data-binding-in-depth Mich würde das auch Interessieren, versteh das nämlich auch nicht so ganz ? Ich hab ne GridView und in dieser GridView, sollen meine Kunden untereinander aufgelistet werden. Scheinbar passiert das über die ItemSource, aber ich schnall nich, was ich hier übergeben muss. Meine Klasse Kunde?
Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.