This is a migrated thread and some comments may be shown as answers.

RadSelectionChangedEventArgs of TabControl

2 Answers 83 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
prog1
Top achievements
Rank 1
prog1 asked on 10 Aug 2010, 10:31 AM
If I register for RadSelectionChangedEvent of the TabControl in code behind it looks like this:

this

 

 

.Tab.SelectionChanged += new RoutedEventHandler(Tab_SelectionChanged);

 

 

 

void Tab_SelectionChanged(object sender, RoutedEventArgs e)

 

{

 

 

    throw new NotImplementedException();

 

}

If I use the XAML IDE of VisualStudio2010 the registered code looks like this and I have to make a cast:

 

 

 

 

 

 

 

<telerik:RadTabControl SelectionChanged="RadTabControl_SelectionChanged" Name="Tab"/>

 

 

 

 

private

 

 

void RadTabControl_SelectionChanged(object sender, RoutedEventArgs e)

 

{

Telerik.Windows.Controls.

 

RadSelectionChangedEventArgs telerikE = e as Telerik.Windows.Controls.RadSelectionChangedEventArgs;

 

}

Is there a way to avoid that cast an only register via XAML?
Changing RoutedEventArgs to RadSelectionChangedEventArgs breaks InitializeComponents().

2 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav
Telerik team
answered on 10 Aug 2010, 01:00 PM
Hi prog1,

Unfortunately I cannot think of a way to register a handler with the RadSelectionChangedEventArgs signature from xaml, the cast is needed in this case.

All the best,
Miroslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
prog1
Top achievements
Rank 1
answered on 10 Aug 2010, 01:51 PM
Hi Miroslav,

thank you for the quick reply.
No problem, just wanted to know.
Tags
TabControl
Asked by
prog1
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
prog1
Top achievements
Rank 1
Share this question
or