datagrid没有属性数据源

时间:2013-03-14 12:05:28

标签: datagrid datasource

我无法使用dataGrid的dataSource属性?

我的用途是

使用System;

使用System.Collections.Generic;

使用System.Linq;

使用System.Text;

使用System.Windows;

使用System.Windows.Controls;

使用System.Windows.Data;

使用System.Windows.Documents;

使用System.Windows.Input;

使用System.Windows.Media;

使用System.Windows.Media.Imaging;

使用System.Windows.Navigation;

使用System.Windows.Shapes;

使用System.IO;

使用System.Data;

 private void button4_Click(object sender, RoutedEventArgs e)
            {
                tabControl1.SelectedIndex = 3;
                dataGrid2.DataSource///////////////does not come up :S

                ExcelData exceldata = new ExcelData();
                this.dataGrid2.DataContext = exceldata;


            }

我错过了什么?

2 个答案:

答案 0 :(得分:0)

它是DataSource而不是Datasource

答案 1 :(得分:0)

请查看DataGrid Datasource property

Windows Datagrid也没有任何Datacontext属性

查看Windows Datagrid