Home Forums WPF controls Xceed DataGrid for WPF Datarow mouseover event question

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #23521 |

    I got a question when I try to use code to trigger a mouseevent event for a datarow.
    dtgList.AddHandler(DataRow.MouseEnterEvent, new RoutedEventHandler(OnDataRowMouseEnter));
    private void OnDataRowMouseEnter(object sender, RoutedEventArgs e)
    DataRow row = sender as DataRow;
    if (row == null) return;//row always null

    Imported from legacy forums. Posted by PP (had 2016 views)

    Xceed Support
    Post count: 5658

    What is the “dtgList” object?

    When registering a handler to a RoutedEvent, the sender will always be the item on which the RoutedEvent is at ( You have to remember that a routed event will go back or forth in the visual tree)…

    If you want to access the “origin” of the event, you have to use the e.Source and/or e.OriginalSource…

    I suggest referring the the MSDN documentation for more details on these properties.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 2997 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.