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

Detecting selection made / deactiveted

I need to be able to detect when a selection is made/deselected in a gridcontrol. I am emulating list box type behavior with external actions required (enabling/disabling buttons) based on the current selection. There appears to be no event for this. I am using CellActivated right now, which is a bad way of doing this - and also there is no way to detect the selection disabled by pushing escape. ... or is there?

4 Replies

AD Administrator Syncfusion Team January 16, 2004 08:11 PM UTC

By selection, do you mean selecting a range of cells (as in grid.Selections.Add(...))? Or do you mean making a single cell the current cell? The SelectionChanging event is the main event for catching the changing a selection. To catch making a cell current, there is a whole series of event that you can use to catch the action at different points in the process. CurrentCellMoving happens at the start, and CurrentCellMoved happens at the end. CurrentCellMovedFailed. CurrentCellRejectedChanges happens when you press esc on an editing cell.


AD Administrator Syncfusion Team January 16, 2004 08:55 PM UTC

I''m talking a range of selected cells (i.e. the entries selected in my virtual ''listbox''). SelectionChanging is exactly what I want, on closer inspection SelectionChanging *is* obviously there but just not in the DataBoundGrid class. i dont understand this! am i missing something? >By selection, do you mean selecting a range of cells (as in grid.Selections.Add(...))? Or do you mean making a single cell the current cell? > >The SelectionChanging event is the main event for catching the changing a selection. > >To catch making a cell current, there is a whole series of event that you can use to catch the action at different points in the process. > >CurrentCellMoving happens at the start, and CurrentCellMoved happens at the end. CurrentCellMovedFailed. CurrentCellRejectedChanges happens when you press esc on an editing cell.


AD Administrator Syncfusion Team January 16, 2004 09:05 PM UTC

The event is in GridDataBoundGrid.Model. this.gridDataBoundGrid1.Model.SelectionChanging += new GridSelectionChangeEventHandler(gridModel_SelectionChanging);


AD Administrator Syncfusion Team January 16, 2004 11:12 PM UTC

great! thanks >I need to be able to detect when a selection is made/deselected in a gridcontrol. > >I am emulating list box type behavior with external actions required (enabling/disabling buttons) based on the current selection. > >There appears to be no event for this. > >I am using CellActivated right now, which is a bad way of doing this - and also there is no way to detect the selection disabled by pushing escape. > >... or is there?

Loader.
Live Chat Icon For mobile
Up arrow icon