Some events fire and some don't ...

TableControlCurrentCellActivating fires
SelectedRecordsChanged does not fire
MouseDoubleClick does not fire

Why is this? 

Does it have anything to do with dynamicly setting the datasource?

I'm trying to do this https://www.syncfusion.com/kb/2450/how-to-get-the-record-when-double-clicked-on-the-row


7 Replies

MG Mohanraj Gunasekaran Syncfusion Team November 23, 2017 10:14 AM UTC

Hi Davy,   
   
Thanks for using Syncfusion product.   
   
Query   
Solution   
SelectedRecordsChanged does not fire.   
By default, this event will be triggered for record selection (ListBoxSelectionMode). We suspect you might have used model based selection (AllowSelection). If you use this selection,SelectedRecordsChanged event has not triggered. So, please ensure that whether you are using ListBoxSelectionMode or AllowSelection  
   
Note   
By default, ListBoxSelectionMode has enabled in GridGroupingControl. Please refer the following UG link,   
   
Please refer to the below KB for more details,   
MouseDoubleClick   
MouseDoubleClick event has handled inside of the GridGroupingControlwhen grid cell getting edit mode. So, we would like to suggest to use theCellDoubleClick instead of the MouseDoubleClick event.   
   
Note:   
This event triggers when the ActivateCurrentCellBehavior asDblClickOnCell. Otherwise you can use the CellClick event.  Please refer the below UG link,   
   
this.gridGroupingControl1.ActivateCurrentCellBehavior =GridCellActivateAction.DblClickOnCell;   
   
You can get the clicked details from CellDoubleClick event using below any one suggestion,   
   
Suggestion1   
You can get the clicked record details from CurrentRecord property. Please refer to the below code example,   
Code example   
Record record = this.gridGroupingControl1.Table.CurrentRecord;   
string value2 = record.GetValue(stye.TableCellIdentity.Column.Name).ToString();   
   
Suggestion2:   
You can get that cell style information GetTableViewStyleInfo method. Please refer to the below code example,   
Code example   
GridTableCellStyleInfo style =this.gridGroupingControl1.TableControl.GetTableViewStyleInfo(e.RowIndex, e.ColIndex);   
string value = style.CellValue.ToString();   
   
Sample link: GridGroupingControl   
   
Regards,   
Mohanraj G   
 



DA Davy November 23, 2017 10:48 AM UTC

Thanks that's clear, i will check it next week


MG Mohanraj Gunasekaran Syncfusion Team November 24, 2017 03:48 AM UTC

Hi Davy, 

Thanks for your update. 

We will wait until we hear back from you. 

Regards, 
Mohanraj G 



DA Davy November 27, 2017 05:58 PM UTC

It is working but not how it should. Still some behaviour that i don't understand.
So this is all the settings and code i use.
Strang, but when i double click ... the event fires 4 or 5 times?
Why is that?

gridProjecten.DataSource = AlgemeneCode.DataFuncties.GetDataBindingsource("SELECT col1,col2,col3, FROM ...);
gridProjecten.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Office2010Blue;
gridProjecten.TableDescriptor.AllowNew = false;
gridProjecten.TableDescriptor.AllowRemove = false;
gridProjecten.TableDescriptor.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Row;
gridProjecten.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Row;
gridProjecten.TableOptions.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One;
gridProjecten.TableDescriptor.Columns[0].Width = 0;
gridProjecten.TableDescriptor.VisibleColumns.Remove("Aanvrager");
gridProjecten.TableDescriptor.Columns[2].Width = 100;
gridProjecten.TableDescriptor.Columns[3].Width = gridProjecten.ClientSize.Width - 200;
gridProjecten.Table.ExpandAllRecords();

gridProjecten.TableControlCellDoubleClick += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventHandler(this.gridProjecten_TableControlCellDoubleClick);

private void gridProjecten_TableControlCellDoubleClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e)
        {
            MessageBox.Show(gridProjecten.TableControl.Table.TableModel[e.Inner.RowIndex, 1].CellValue.ToString());
        }


MG Mohanraj Gunasekaran Syncfusion Team November 28, 2017 12:09 PM UTC

Hi Davy,      
   
Thanks for your update.   
   
We have analyzed and tried to reproduce your reported scenario using provided code part, but we were unable to reproduce your scenario. Please refer the test cases below,   
   
  • Tested with flat and child table.
  • Tested with CellDoubleClick and TableControlCellDoubleClick event for parent and child table.
  • Tested in Syncfusion product version 15.4.0.17
  • Tested with record expand and collapse state.
   
Please provide us with simple video of your scenario and customization regarding mouse actions if any and please refer to the attached sample and let us know if we missed anything from your customization. It will be helpful to provide the solution at the earliest.   
   
Sample link: GridGroupingControl   
   
Please let us know if you have any concerns.   
   
Regards,   
Mohanraj G   
 



DA Davy December 22, 2017 10:24 AM UTC

Problem of firing more then once still exists in my application, but i solved it by bool firstFire true to false ...

But tried to make a demo for you but can't reproduce it in a new application.

So i m closing this tread

Thanks for the great support!


AR Arulpriya Ramalingam Syncfusion Team December 26, 2017 08:32 AM UTC

Hi Davy, 
 
Thanks for your appreciation.    
 
Please let us know if you have any other queries, we are happy to assist you.    
   
Regards, 
Arulpriya 


Loader.
Up arrow icon