2013-03-14 64 views
0

我不能使用dataGrid的dataSource屬性?datagrid沒有屬性數據源

我使用的是

使用系統;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

using System.IO;

using 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; 


      } 

我錯過了什麼?

回答

0

DataSourceDatasource

+0

看看它是隻u顯示它沒有出現,當我寫dataGrid2.Data ....?瞭解我這是onlt DataContext出來了 – AlpK 2013-03-14 12:14:47

+0

是DataSource唯一沒有出現或者不出現的東西? – 2013-03-14 12:19:02

+0

只有其他dataContext和dataContextChanged出現。 – AlpK 2013-03-14 12:25:46