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.

Firing event when GridDataColumnStyle CellType="CheckBox" is checked

Thread ID:

Created:

Updated:

Platform:

Replies:

113660 Oct 3,2013 11:00 AM Nov 19,2013 05:18 AM WPF 1
loading
Tags: GridControl
Massi
Asked On October 3, 2013 11:00 AM

Hi my question is the following:
you can use a Command when the checkbox is selected?
former code snippet: 

<syncfusion:GridDataVisibleColumn HeaderText="Graph Signal"
                                                          MappingName="Selected">

                            <syncfusion:GridDataVisibleColumn.ColumnStyle>

                                <syncfusion:GridDataColumnStyle CellType="CheckBox"
                                                                HorizontalAlignment="Center"
                                                                IsThreeState="False">

                                </syncfusion:GridDataColumnStyle>
                            </syncfusion:GridDataVisibleColumn.ColumnStyle>
                            <syncfusion:GridDataVisibleColumn.HeaderStyle>
                                <syncfusion:GridDataColumnStyle HorizontalAlignment="Center" />
                            </syncfusion:GridDataVisibleColumn.HeaderStyle> 
                          
                            <i:Interaction.Triggers>
                                <i:EventTrigger EventName="CheckBoxClick">
                                    <i:InvokeCommandAction Command="{Binding SelectedChannelCommand}" />
                                </i:EventTrigger>
                            </i:Interaction.Triggers>


                       </syncfusion:GridDataVisibleColumn>

I await your answers,
thank you.
Alessio Massimiliano

Saravanan M [Syncfusion]
Replied On November 19, 2013 05:18 AM

Hi Massi,

We are sorry for the delay

We have analyzed your query. If you want to handle checkbox clicked event,you have to hook the CurrentCellChanged event. You can refer the below codesnippet to achieve your requirement.

Codesnippet[C#]:

this.syncgrid.CurrentCellChanged += new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(syncgrid_CurrentCellChanged);

   void syncgrid_CurrentCellChanged(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args)

        {

            var currentcellmanager = this.syncgrid.Model.CurrencyManager;

            if (currentcellmanager.CurrentCell.HasCurrentCell)

            {

                var currentcell = currentcellmanager.CurrentCell;

                if (currentcell.Renderer is GridCellCheckboxRenderer)

                {

                    var value = currentcell.Renderer.ControlValue as bool?;

                    if ((bool)value)

                    {

                        MessageBox.Show("checkbox selected");

                    }

                    else

                    {

                        MessageBox.Show("checbox unselected");

                    }

                }

            }

        }

 

 

We have prepared sample based on your requirement and please find the attachment sample below.

Please let us know if you have any queries,

Regards,

Saravanan.M



GridDataControl_checkbox_Eventhandle_ff0ff7ce.zip

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.

;