爲什麼它不起作用?錯誤:元素不能是其父項
dataGrid.Columns.Add(new DataGridTextColumn()
{
Header = new DataGridColumnHeader
{
Name = eName,
Background = Brushes.AliceBlue
}
});
錯誤是:
A first chance exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dll
Additional information: Element cannot be its own parent.
你能表現出一些其他的代碼 - 如何你聲明,創建和使用'dataGrid'? –