I am creating a Silverlight application. In which I have taken a ChildWindow
and in this ChildWindow
taken a grid and OK. Now I want a selected row of grid when ok button is clicked. And hence I have created a Event delegate for button click. But the delegate is not calling at all.
I have delegated selectetionchanges event of DataGrid
also it is calling perfectly but button click is not delegating, Following lines shows how i have created delegates for both selection change and button click
PossibleAvailibiltyWindow.dgAvailibilityOption.SelectionChanged += new SelectionChangedEventHandler(dgAvailibilityOption_SelectionChanged);
PossibleAvailibiltyWindow.OKButton.Click += new RoutedEventHandler(OKButton_Click);
"dgAvailibilityOption_SelectionChanged" is calling but "OKButton_Click" is not
I have written this in Parent (Main.xaml.cs)
not in ChildWindow
as i want to handle the event in parent rather than in ChildWindow
code behind.
Any ideas, what i am doing wrong?