dimanche 21 août 2016

How to check A dynamically created Check box in WPF

Here I need to add a check box dynamically in data grid view.Data grid view loaded from DB. Each row in data grid view must have a check box , that check box check property decided from one column in data grid view ( read particular value from Data grid view , and check it- if column has True then check box check, false then check box unchecked)

 DataGridTemplateColumn dgc = new DataGridTemplateColumn();
            DataTemplate dtm = new DataTemplate();

            FrameworkElementFactory checkbox = new FrameworkElementFactory(typeof(CheckBox));

            dtm.VisualTree = checkbox ;
            dgc.CellTemplate = dtm;
            dgrid.Columns.Add(dgc);

It create a check box at end of each row! Here how can I accomplish check property of each and every check box!




Aucun commentaire:

Enregistrer un commentaire