We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to get the event cheked in Syncfusion : GridCheckBoxColumn ?

Thread ID:

Created:

Updated:

Platform:

Replies:

120904 Oct 26,2015 04:51 PM Oct 28,2015 05:03 AM WPF 3
loading
Tags: SfDataGrid
Luis Fernando
Asked On October 26, 2015 04:51 PM

 <syncfusion:GridCheckBoxColumn TextAlignment="Center" x:Name="chkImpuesto" AllowEditing="True" HeaderText="{DynamicResource Texto_Impuestos}" MappingName="Impuestos" Changed="chkImpuesto_Changed" />

                             

Jai Ganesh S [Syncfusion]
Replied On October 27, 2015 05:12 AM

Hi Luis,

Thank you for using Syncfusion Products.

We analyzed your query. Due to GridCheckBoxColumn behavior it does not fire any Editing events. Instead of editing events you can use CurrentCellvalueChanged event to get fired when the check box value is changed.
Code Example [C#]:

private void grid_CurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs args)

     {

            SfDataGrid grid = sender as SfDataGrid;

            int columnindex = grid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex);

            var column = grid.Columns[columnindex];

            if (column.GetType() == typeof(GridCheckBoxColumn))

            {

                MessageBox.Show("Checkbox value changed ");

            }
     }



We have also prepared a sample based on this and you can download the sample from the below location,

Sample: http://www.syncfusion.com/downloads/support/directtrac/145903/ze/DataGrid-1284954582

Please let us know if you have any query.

Regards,
Jai Ganesh S


Luis Fernando
Replied On October 27, 2015 02:10 PM

Hi Luis,

Thank you for using Syncfusion Products.

We analyzed your query. Due to GridCheckBoxColumn behavior it does not fire any Editing events. Instead of editing events you can use CurrentCellvalueChanged event to get fired when the check box value is changed.
Code Example [C#]:

private void grid_CurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs args)

     {

            SfDataGrid grid = sender as SfDataGrid;

            int columnindex = grid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex);

            var column = grid.Columns[columnindex];

            if (column.GetType() == typeof(GridCheckBoxColumn))

            {

                MessageBox.Show("Checkbox value changed ");

            }
     }



We have also prepared a sample based on this and you can download the sample from the below location,

Sample: http://www.syncfusion.com/downloads/support/directtrac/145903/ze/DataGrid-1284954582

Please let us know if you have any query.

Regards,
Jai Ganesh S


Now as I get the value of GridCheckBoxColumn?

Jai Ganesh S [Syncfusion]
Replied On October 28, 2015 05:03 AM

Hi Luis,

You can get the CheckBoxColumn value in CurrentCellValueChanged event by using the Rowindex like the below code example,
Code Example [C#]:

private void grid_CurrentCellValueChanged(object sender, CurrentCellValueChangedEventArgs args)

        {

            SfDataGrid grid = sender as SfDataGrid;

            int columnindex = grid.ResolveToGridVisibleColumnIndex(args.RowColumnIndex.ColumnIndex);

            var column = grid.Columns[columnindex];

            if (column.GetType() == typeof(GridCheckBoxColumn))

            {

                var rowIndex = this.grid.ResolveToRecordIndex(args.RowColumnIndex.RowIndex);

                var record = this.grid.View.Records[rowIndex].Data as Student;

                var value = record.IsCheck;

            }
        }   



We have also modified the  sample based on this and you can download the sample from the below location,

Sample: http://www.syncfusion.com/downloads/support/directtrac/146186/ze/DataGrid518228312

Regards,
Jai Ganesh S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;