c# - How do I set the ItemsSource of a DataGrid in XAML? -
I am trying to set a DataGrid
property of dgIssueSummary
should be a observation code
named IssueSummaryList
. Currently, when I set the ItemsSource
property in my code-behind, everything is working:
Public partial class home page: UserControl {Personal Observeable Collection & lt; IssueSummary & gt; Problematic list = new observational compilation & lt; Numerals & gt; Public ManPage () {InitializeComponent (); DgIssueSummary.ItemsSource = IssueSummaryList}}
However, I want to set the ItemsSource
property in XAML, but I can not get it to work. Here is the XML code I:
& lt; Sdk: DataGrid x: name = "dgIssueSummary" AutoGenerateColumns = "False" ItemsSource = "{Binding Points Ms. List}" & gt; & Lt; SDK: DataGrid.Columns & gt; & Lt; Sdk: DataGridTextColumn binding = "{binding problem type}" header = "problem type" /> & Lt; Sdk: DataGridTextColumn binding = "{binding calculation}" header = "calculation" /> & Lt; / SDK: DataGrid.Columns & gt; & Lt; / SDK: data grid & gt; What should I do to set the - ItemSource
property to IssueSummaryList
instead of CA in XAML?
You need to make a property "problematic list". If you do this, you can force it directly. You can not tie through Xaml in a private area.
You will need to set DataContext
to " this
" (or use the other method to obtain the appropriate example).
Comments
Post a Comment