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.

Events in DataGridControl related to navigation

Thread ID:

Created:

Updated:

Platform:

Replies:

90499 Oct 5,2009 01:11 PM Oct 6,2009 05:39 AM WPF 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 5, 2009 01:11 PM

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.


Clay Burch [Syncfusion]
Replied On October 6, 2009 05:39 AM

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

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.

;