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. Image for the cookie policy date
close icon

SelectedRecordsChanged and SelectedRecordsChanging events not firing

Hi,

1) The SelectedRecordsChanged and SelectedRecordsChanging in GroupingGrid is not firing. What am I doing wrong. I am trying to implement a master detail grid.

I will appreciate any sample with this implementation.

2) Is it possible to show master detail records in a single grid using DataSet DataRelations or I have to use two grids.

Thanks,
Alomgir

4 Replies

RC Rajadurai C Syncfusion Team June 8, 2009 04:23 PM UTC

Hi Alomgir,

Thanks for your interest in Syncfusion Products.

Please refer to the following sample in which the master-detail relation in single grid is shown. The relations among the nested childs have to be added manually to achieve this along with dataset relations. The SelectedRecordsChanged and SelectedRecordsChanging events get fired only when the following properties were set.

this.gridGroupingControl1.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None;
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;


Here is the sample.
http://files.syncfusion.com/support/samples/Grid.Windows/7.2.0.20/F82248.zip

Regards,
Rajadurai


AM Alomgir Miah June 8, 2009 09:05 PM UTC

That was helpful.

Thanks,
Alomgir


OL Otavio Lima December 15, 2021 08:40 PM UTC

I want to have the same behavior bug allowing me to selected cells only. Not all the row.



SS Sampathnarayanan Sankaralingam Syncfusion Team December 16, 2021 01:01 PM UTC

Hi Otavio Lima, 
 
To perform cell selection, you need to set the `gridGroupingControl1.TableOptions.AllowSelection` as `GridSelectionFlags.Cell`.  

Code snippet :  
this.gridGroupingControl1.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.Cell; 
 
You can get notification for the cell selection by using the SelectionChanged and SelectionChanging event. Please refer the code snippet below. 

Code snippet :  
this.gridGroupingControl1.TableModel.SelectionChanging += OnTableModel_SelectionChanging; 
this.gridGroupingControl1.TableModel.SelectionChanged += OnTableModel_SelectionChanged; 

private void OnTableModel_SelectionChanging(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangingEventArgs e) 
{ 
    Console.WriteLine("Changing"); 
} 
 
private void OnTableModel_SelectionChanged(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventArgs e) 
{ 
    Console.WriteLine("Changed"); 
} 


Regards, 
Sampath Narayanan.S 


Loader.
Live Chat Icon For mobile
Up arrow icon