Articles in this section
Category / Section

How do I add or remove items in a GroupBar at runtime using procedural code?

1 min read

 

The following code snippet can be used to add items to a GroupBar.

[C#]

GroupBar myGroupBar = new GroupBar(); GroupBarItem gbi = new GroupBarItem(); TextBlock tt1 = new TextBlock(); tt1.Text = "New Item added"; gbi.Header = "Dynamic Items"; gbi.Content = tt1; myGroupBar.Items.Add(gbi);

The following code snippet can be used to remove items from a GroupBar

[C#]

myGroupBar.Items.Remove(gbi);

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied