Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
725
How to identify that double click is from xam data grid row or scroll viewer.
posted

Hi

I am using xam datagrid with multi level.In that i handle mouse double click event and in that i will expand or collapse all child.

here is my code..

private void XamDataGridExpander_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (e.ChangedButton == System.Windows.Input.MouseButton.Left)
{
XamDataGrid xdgGrid = e.Source as XamDataGrid;
if (xdgGrid != null && xdgGrid.ActiveRecord != null)
{
if (xdgGrid.ActiveRecord.IsExpanded)
{
CommonLogic.ExpandRecord(xdgGrid.ActiveRecord, false);
}
else
{
xdgGrid.ActiveRecord.IsExpanded = true;
}
}
}
}

It is working fine.But when data is more then the visible area there we see scroll viewer. In that when we click double click on scrollviewer it calls to the xamgrid XamDataGridExpander_MouseDoubleClick event.

So please can you tell me how to identify that double click event is from scroll viewer or data record presenter.

Here i attached example.In that when i select any one row and then double click on scrollbar  it execute as selected row double click.

Thanks 

Adit Sheth

DataGridPresenterScrolling.zip