We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataGrid以mvvm模式binding Datatable 时数据并没有显示出来,当把style清除后数据才可以显示出来,怎么回事?
The text was updated successfully, but these errors were encountered:
需要将AutoGenerateColumns="True"即可
AutoGenerateColumns="True"
1.xaml
<DataGrid AutoGenerateColumns="True" ItemsSource="{Binding DataTableItems}"/>
2.cs
var dataTable = new DataTable(); dataTable.Columns.Add("ID", typeof(int)); dataTable.Columns.Add("Name", typeof(string)); dataTable.Rows.Add(1, "WPFDevelopers"); dataTable.Rows.Add(2, "WPFDevelopers"); dataTable.Rows.Add(3, "WPFDevelopers"); DataTableItems = dataTable;
Sorry, something went wrong.
No branches or pull requests
DataGrid以mvvm模式binding Datatable 时数据并没有显示出来,当把style清除后数据才可以显示出来,怎么回事?
The text was updated successfully, but these errors were encountered: