3 Answers, 1 is accepted
0
Hello Amit,
The outcome from the above is the following:
If the above does not help, could you please share more details about your scenario and the way you populate RadPanelBar.
Greetings,
Kiril Stanoev
the Telerik team
Are you binding RadPanelBar or you're populating it with RadPanelBarItem's on the fly, as shown bellow:
public
MainPage()
{
InitializeComponent();
RadPanelBar panelBar =
new
RadPanelBar();
RadPanelBarItem panelBarItem =
new
RadPanelBarItem();
StackPanel stackPanel =
new
StackPanel();
stackPanel.Orientation = Orientation.Horizontal;
TextBlock header =
new
TextBlock();
header.Text =
"Header"
;
header.VerticalAlignment = System.Windows.VerticalAlignment.Center;
header.Margin =
new
Thickness(10, 0, 10, 0);
Button closeButton =
new
Button();
closeButton.Content =
"CLOSE"
;
closeButton.Click +=
new
RoutedEventHandler(CloseButton_Click);
stackPanel.Children.Add(header);
stackPanel.Children.Add(closeButton);
panelBarItem.Header = stackPanel;
panelBar.Items.Add(panelBarItem);
this
.LayoutRoot.Children.Add(panelBar);
}
private
void
CloseButton_Click(
object
sender, RoutedEventArgs e)
{
MessageBox.Show(
"Close Button Clicked"
);
}
The outcome from the above is the following:

If the above does not help, could you please share more details about your scenario and the way you populate RadPanelBar.
Greetings,
Kiril Stanoev
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

Amit
Top achievements
Rank 1
answered on 26 May 2011, 12:16 PM
Thanks for Sending Code For RadPanel Close Button
Question is that .How Can I Close the RadPanelBar Using CloseButton
Question is that .How Can I Close the RadPanelBar Using CloseButton
0
Hi Amit,
You can use the telerik`s generic extension method ParentOfType<> in order to detect the parent RadPanelBarItem ( the container) of the clicked button. Then just remove the container from the items collection of the PanelBar. You can examine this realized in the attached solution.
Kind regards,
Petar Mladenov
the Telerik team
You can use the telerik`s generic extension method ParentOfType<> in order to detect the parent RadPanelBarItem ( the container) of the clicked button. Then just remove the container from the items collection of the PanelBar. You can examine this realized in the attached solution.
Kind regards,
Petar Mladenov
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