views:

419

answers:

2

I'm just starting out with WPF and need some help with routed events. I have added a datagrid with some animation, but i can't seem to find anywhere that shows me a list of routed events to use on the datagrid, or any other control for that matter. Seems to be a guessing game so far.

I thought the datagrid standard events, such as CellEditEnding, was it but they are not as it says "Invalid event name".

The example I copied used a MouseEnter routed event, but i don't know what else there is for me to use (except my own of course).

<Window.Triggers>
    <EventTrigger RoutedEvent="my:DataGrid.MouseEnter">
        <BeginStoryboard Storyboard="{StaticResource MyAnimation}"/>
    </EventTrigger>
</Window.Triggers>

thanks in advance for you help

+1  A: 

You can get the full list of events that are exposed by a control by looking at its documentation on MSDN. The DataGrid is a bit of a special case, since it isn't part of the main framework (yet), only available in the WPF Toolkit. However, there is documentation for the .NET 4.0 version of the DataGrid here - I'm not sure how that compares to the Toolkit version of the control, though.

If you attempt to subscribe to the event in the tag for the control itself in your XAML file, Visual Studio should provide intellisense which includes the properties and events of the control.

Andy
+2  A: 

In your code, call static EventManager.GetRoutedEvents() method to get list of routed events registered/available to your application.

Wallstreet Programmer