I should do binding for datagrid dynamically at code.I wrote the code as below. When I debug this code block ,it seems that it does bindings correctly, but grid comes with no columns on form.
MyClass myInstance=new MyClass ();
dataGridObject.Width = 200;
dataGridObject.Height = 200;
binding = new Binding();
binding.Source = myInstance;
foreach (PropertyInfo prop in myInstance.GetType().GetProperties())
binding.Path = new PropertyPath(prop.Name);
DataGridTextColumn column=new DataGridTextColumn();
column.Header = prop.Name;
Why does't come grid with columns, although I did necessary bindings?
Thanks for the replies in advance..
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)