Is there any way to get the RecordActivated event to fire on a mouseover instead of when it is clicked?
I want a popup to appear when i mouse over the row instead of when i click on it with information about the row i am moused over.
Right now, i have code like this
<igDP:XamDataPresenter
x:Name="DataPresenter1"
DataSource="{Binding Path=Data}"
RecordActivated="DataPresenter1_RecordActivated">
where the event gets fired once i click on a row and everything works fine. but I would like it to handle my popup on mouse enter instead. any ideas? is it also possible to get my mouse location and have the popup appear next to my mouse?
nevermind i figured it out! Thanks alex
Thanks Alex!! setting the record.isactive worked perfectly!
One question regarding the PlacementMode. I think that only works on a Popup object. I have a Grid that is hidden, and i have a story board that shows and hides this grid. is there any way to apply something similar to my case?
my storyboard:
<Storyboard x:Key="ShowPopup">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Popup" Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Popup" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.7"/>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Popup" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Popup" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
<DiscreteObjectKeyFrame KeyTime="00:00:00.2" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
and my grid:
<Grid
x:Name="Popup"
VerticalAlignment="Center"
Width="Auto"
Height="Auto"
Grid.Row="1">
{...}
</Grid>
Hello,
This is possible, following these steps:
1. Registed a MouseEnter event for the DataRecordPresenter, or DataRecordCellArea, using the EventManager class:
EventManager.RegisterClassHandler(typeof(DataRecordPresenter), DataRecordPresenter.MouseEnterEvent, new MouseEventHandler(drp_MouseEnter));
void drp_MouseEnter(object sender, MouseEventArgs e)
{ ... }
2. Make the record active when you enter the DataRecordPresenter in the drp_MouseEnter handler:
p.IsOpen = false;
DataRecordPresenter drp = sender as DataRecordPresenter;
drp.Record.IsActive = true;
3. This will fire the RecordActivated event, which you can use to show your popup (p)