我讀像這樣通過添加內容的ItemsSource到WPF的datagridview
string appDataPath1 = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
string configPath1 = appDataPath1 + "/LWRF/ReaderProfiles";
string fn = System.IO.Path.Combine(configPath1 + ComboBoxProfiles.Text);
_currentProfile.Clear();
try
{
Log("Loading profile: " + fn);
_currentProfile.ReadXml(fn);
_dgvProfile.ItemsSource = _currentProfile.DefaultView;
}
catch
{
}
一個XML文件,我需要做的,使XML文件內容在GridView顯示什麼呢?我將這段代碼添加到ComboBox_SelectionChanged
事件中,但即使在選擇更改後,我的datagridview也是空白的。
有在'_currentProfile.DefaultView'的數據? – 2013-02-16 21:59:48
是的,裏面有數據。感謝您回覆sa_ddam213! – 2013-02-18 03:27:28