It is a part of GraphicsTable Class //Custom Classes "DrawingCanvas & GraphicsTable" public void CreateDataGrid(GraphicsTable graphicsTable, DrawingCanvas drawingCanvas) { dt = new DataGrid(); dt.Name = "Data"; dt.ItemsSource = person(); dt.AllowDrop = true; dt.AutoGenerateColumns = true; dt.Height = graphicsTable.Rectangle.Height; dt.Width = graphicsTable.Rectangle.Width; drawingCanvas.Children.Add(dt); Canvas.SetTop(dt, graphicsTable.Rectangle.Top); Canvas.SetLeft(dt, graphicsTable.Rectangle.Left); dt.Width = dt.Width; dt.Height = dt.Height; dt.Focus(); } //I have just tried to add dome dummy data to the datagrid. public List person() { List peep = new List(); peep.Add(new Person() {}); return peep; } } public class Person { private string name; private double salary; public string Names { get { return name; } set { name = value; } } public double Salary { get { return salary; } set { salary = value; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)