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

Events in DataGridControl related to navigation

We're trying to use the DataGridControl control in a master/detail view situation.

As part of this, we're attempting to use some of the events on this control to track the currently active cell, and assign a secondary user control in the window based off the element assigned in the current cell.

Right now, we're attempting this using the CurrentCellActivating and CurrentCellActivated events. However, we've run into two issues.

1) Setting cancel=true in CurrentCellActivating doesn't seem to prevent the current cell from switching. Is there a better event we should be using to prevent this? (We want to be able to keep the user from changing "rows" in the grid, under certain circumstances).

2) CurrentCellActivated seems to fire BEFORE SelectedItem has changed. Right now, we're trying to set the detail UI off the grid control's SelectedItem property in CurrentCellActivated, but this seems to be the "item" corresponding to the LAST active cell, even though it's in the Activated event. What can we use to correctly track this information?

Thank you.


1 Reply

CB Clay Burch Syncfusion Team October 6, 2009 09:39 AM UTC

Here is a sample that shows one way to get master-details GridDataControls working. It uses CurrentCellMoved to sync up the details grid with the master grid. It also uses QueryCellInfo to disable any row that you do not want to become current for some reason.

If you are using our 7.4 (preview code), you will get a syntax error on a couple lines involving:

masterGrid.Model.Binder.GetItemAt


There is a new API for later releases. In the later code, try using:

GetItemAtmasterGrid.Model.View.Records.GetItemAt




MasterDetailsGDCs_99cfbe19.zip

Loader.
Live Chat Icon For mobile
Up arrow icon