How to Add a CheckBoxColumn?

Hi Team, 

I am trying to add a checkboxcolumn into the UWP sfdatagrid. Is there a way to do it like below?

            DataGridCheckBoxColumn checkbox = new DataGridCheckBoxColumn();
            checkbox.Header = "";
            checkbox.Width = 30;
            dataGrid.Columns.Add(checkbox);

Or does it need to be done in XAML? Specifically is there a GridCheckBoxColumn (I think this is available in WPF) in the Syncfusion extension for UWP? If so, can you explain how it works?

    
          

If there are other suggestions, I''m open to them. 

Regards,
Josh



2 Replies

PV Peter Verbo December 6, 2017 05:34 PM UTC

In XAML it is quite simple:

                    <sfDataGrid:GridCheckBoxColumn MappingName="IsChecked"
                                                   HeaderText=""
                                                   AllowEditing="True"
                                                   ColumnSizer="Auto"/>


JG Jai Ganesh S Syncfusion Team December 7, 2017 05:58 AM UTC

 
You can add the CheckBoxColumn at code behind in UWP platform like WPF. We have prepared a sample for this and you can refer the sample from the below location, 
 
 
var checkBoxColumn = new GridCheckBoxColumn() {MappingName="IsSelected", 
                                               HeaderText = "", 
                                               AllowEditing = true, 
                                               ColumnSizer = GridLengthUnitType.Auto 
            }; 
this.datagrid.Columns.Add(checkBoxColumn); 
 
 
 
Regards, 
Jai Ganesh S

Loader.
Up arrow icon