Adding rows to a WPF datagrid where columns are not known until runtime
问题 I'm trying to add data to a datagrid (in fact, any control that presents data in a grid will do), but the columns (both names and numbers) are not known until runtime. The columns I DO know how to create: E.g DataGridTextColumn textColumn = new DataGridTextColumn(); textColumn.Header = column.DisplayName; MyDataGrid.Columns.Add(textColumn); But how do I add rows? I don't see how I can use binding because my data is not contained in an object with known properties. For example, data for each