Hi all.I am using a xamdatagrid and on double click event i am opening one window,Problem is when i double click on any where in xamdatagrid even on header and also scrollviewer, window is opening.So how can i overcome this problem.I am sending the example with double click event for xamdatagrid.If i double click on header also message box is displayed.So plz solve this problem.
Hi this will not help me.It showing some error.Can u plz send me a sample by solving this issue.If i double click on the scrollviewer also control is going to double click event of xamdatagrid.
dude you dnt need the bhaviour class actually
the event shoule be fine to handle
Hey dude,
declare a class say xamdatagridbehaviour
public
static class XamDataGridBehaviour
{
//Custom handler for Mouse Double Click
EventBehaviourFactory.CreateCommandExecutionEventBehaviour(XamDataGrid
.MouseDoubleClickEvent,
"MouseDoubleClickCommand"
,
typeof (XamDataGridBehaviour
));
public static void SetMouseDoubleClickCommand(DependencyObject o, ICommand
value)
o.SetValue(MouseDoubleClickCommand, value);
}
public static ICommand GetMouseDoubleClickCommand(DependencyObject o)
return o.GetValue(MouseDoubleClickCommand) as ICommand;
Now in ur code behind .cs file
attach a event for double click
inside event check for the following : -
var
drp =
Infragistics.Windows.
Utilities.GetAncestorFromType(e.OriginalSource as DependencyObject,typeof(DataRecordPresenter), true) as DataRecordPresenter;
if (drp != null && drp.Record != null && drp.Record is HeaderRecord)
e.Handled =
This shall solve your problem
true;
Hi,
In ultrawingrid we basically write a mouse down event , that should get fired on double click as well. Next , we have the follwing method .
public static bool IsHeaderClick(UltraGrid dgTemp, MouseEventArgs e)
bool headerClickedFlag = false;
UIElement aUIElement = dgTemp.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
if ((aUIElement != null))
if ((aUIElement.GetContext()) is ColumnHeader)
headerClickedFlag =
return headerClickedFlag;
Please let me knw what corrsponding method , property u find for xamdatagrid.i am also using this now a days.so u r input might come in handy smtime
Is their any sample or example of that ultrawingrid? i dont no how to use that one.