Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How add and bind DataGrid columns programmatically ??

$
0
0

Hi all,

 

How are you ??

 

please i need to know how to add and bind DataGrid columns programmatically ( NOT IN XAML),

i was using  this code in windowsForms i need equivalent for it in WPF please :

            DataGridViewColumn column = new DataGridViewTextBoxColumn();
            column.DataPropertyName = "DataPropertyName";
            column.Name = "columnName";
            column.DisplayIndex = 1;
            column.Width = 150;
            column.ReadOnly = true;
            column.Visible = true;
            Datagrid1.Columns.Add(column);

 

help me please , Thanks a lot .....


 

 

 

 

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>