.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How To Setup Expander Control for TabItems in TabControl?

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :WPF
Hii.. I'm having a TabControl which TabStripPlacement is left side means all TabItems are exist in left side of window (Look like side menu).. so i want to place Expander control for TabItems only, which is used like expand the expander and select respective TabItem and close expander like that.   sample picture...                        _________________________________________________________________________ TabItem1   E   |                                                                                                                               | TabItem2   X   |      &n

View Complete Post

More Related Resource Links

Why is there no wizard control in WPF? Is there an easy way to create one, like with the TabControl

Hello, First, NO THIRD PARTY PRODUCTS!  In my search, it seems like anyone asking for a wizard control is sent to a third party to buy it.  I have no interest in buying a third party product, so if you are one of those that would suggest it, please don't, I'm simply not interested. If my understanding of page framework is correct, that is, the page is within a separate XAML file and the events are handled via its code behind, then I am not interested in such a scenario.  Nor am I interested in any fancy plumbing to make page framework work the way I want. All I want is the simple wizard control.  I'm amazed that such an important function was left out of WPF, especially since the TabControl is so close to being a Wizard Control. I'm thinking that the TabControl should be able to be made to function like a wizard, but my search finds nothing of any value.  Is the TabControl not suitable to be made to function like a wizard? Any help (other than third party products) would be greatly appreciated. Regards, Robert

MVVM. Access TabControl->TabItems from ViewModel

Hi Folks,   Well, I just start to use MVVM, and I want to migrate functionality from my old non mvvm project to my new mvvm project.   The problem is the following one: In my old app (wizard application), I use tab control. And I have such things as States there. For this purpose I use StateMachine approach: My tab control looks like:   private void sm_StateChanged(State current, State previous, State next) { switch (current.Name) { case StatesNames.WELCOME_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 0; break; case StatesNames.SERVER_SUMMARY_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 1; preCertificationTabControl.SelectedIndex = 0; break; case StatesNames.SERVER_DEFINITION_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 1; preCertificationTabControl.SelectedIndex = 1; break; case StatesNames.UPGRADE_PRECERTIFICATION_SCREEN_STATE_NAME: MainTabControl.SelectedIndex = 1; preCertificationTabControl.SelectedIndex = 2; break; case StatesNames.PRECERTIFICATION_SCREEN_STATE_NAME: NavigationStateMachine.GetInstance().SwitchToNextState(); break; } } Well, as you can see, I need to access my tabControl to indicate states :( but it is not correct from

expander control - how to expand "over" something?

I've re-styled the standard expander control to expand horizontally and I am looking for a way for the expander to "expand" over top of other controls on the window instead of pushing them around and forcing the UI to re-draw portions of itself. This is a direct copy of the Visual Studio side and bottom menu pop out behaviors, if that helps anyone understand what I am trying to achieve. I have searched these forums and I found a solution that involves using a Canvas to wrap around the expander but I was looking for a way to accomplish this same task without the Canvas object. The reason for this is that canvas does not provide a method to resize its children and my expander currently can resize itself if provided more room. I do not wish to break this behavior. I obviously tried setting the Panel.Zindex directly on my expander object but this didn't do much for me.  If anyone has any suggestions I can try post them here so I can try to add them in over the next couple of weeks to my project. Thanks in advance for any assistance!

Doubt regarding the expander control in WPF.

I want to use multiple expanders in a WPF application and i want to expand multiple expanders at the same time. I was thinking that it would be great if i could implement the following. If at any point in time, if only one expander is expanded, it shows its contents as it is but if any other expander is already expanded, then the expander being expanded would open with a scrollbar inside, displaying its contents on-scroll. thus we can have many expanders expanded at the same time without the problem of them overlapping. Any pointers or ideas regarding the same would be of great help. Regards Vignesh

Expander control is not expanded during design time


Hi all,

I've an expander control placed within a windows XAML as mentioned below. But the expander is not expanded at the design time. What could be the problem? and how can i see at the design with the embeded controls?





how to animate the toogle button of a expander control ?




i would like to know, how can i implement a "smooth expand/collapse" animation for a header icon (tooglebutton) of a expander control ?

may be like the icon of the AccordionItem.Header of a Accordion control.


thanks for any help



How to increase the height of Expander control HEADER in XAML



How to increase the height of Expander control HEADER in XAML?



Many Thanks Deepak

Get TextBox control from TabControl.ContentTemplate


Is there any posibility to get the tbContent TextBox (defined in the ContentTemplate for the TabControl) from within the TabControl_SelectionChanged event handler?

<Page x:Class="TabControlTemplate.Page1"
        <XmlDataProvider x:Key="myData" XPath="/Data">
                <Data xmlns="">
                    <Item id="1" value="1" />
                    <Item id="2" value="2" />
                    <Item id="3" value="3" />
                    <Item id="4" value="4" />
        <TabControl ItemsSource="{Binding Source={StaticResource myData}, XPath=Item}"
                    <TextBlock Text=&qu

Set focus on erronous control on validation inside ajax tabcontrol having 5 tab


Hiii.. Everybody

How to set the focus on textbox when requiredfield validator error mesage comes to action inside the ajax tabcontrol.The ajax tabcontrol is having 5 tabs.The submit button is in 5th tab .I have reqiredfield validator for textbox  in 1st tab.I want to set the focus on textbox if validation fails.Is it possible to get without postback????

Is there anyone can help me out ????

Thanks in advance

Extending the expander control - MVVM pattern


Hi all,


I am using MVVM and need to create an expander that also has a "close" button, making it disappear.

I thought about creating a UserControl containing an Expander + Button with "close" caption.

Then, expose a Command property for that button click, handling it in the ViewModel.

Problem is, I have to expose many other Expander related properties as well (content, IsExpanded, IsEnabled etc...)

Is there any other idea for this issue?


Thanks a lot!

"Unable to cast object of type 'System.Windows.Controls.Expander' to type 'System.Windows.Control



I Got This Error: "Unable to cast object of type 'System.Windows.Controls.Expander' to type 'System.Windows.Controls.GroupBox'"


In XAML file Code of Control Herarchy is like this





here i declare 10 Expander

<Expander 1>...<expander10>

and in each expander there is 1 <Grid> Control





Now my code is working fine....but problem is i want to remove Expander10

so i removed <Expander10> andrelated code from CS file.

codes compiled successfully. but when i Open this screen i got this error on InitializeComponent() and Error shows in XAML page.


"Unable to cast object of type 'System.Windows.Controls.Expander' to type 'System.Windows.Controls.GroupBox'"

Please Help me for this Error.

it's really strenge what's wrong in removing expander from herarchy......

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

In-Depth look at the GridView Control

In the last article we looked at few of the new controls available in Asp.net 2.0. We also talked about Grid View Control which has replaced the Asp.net 1.1 DataGrid control for good. In this article we will examine more features of the Grid View control. In this article we will see some of the common operations that can be performed using the GridView control. Apart from these operations there are many more functions that can be performed on the control and which we will see in the later articles

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Using TemplateFields in the GridView Control

The GridView is composed of a set of fields that indicate what properties from the DataSource are to be included in the rendered output along with how the data will be displayed. The simplest field type is the BoundField, which displays a data value as text. Other field types display the data using alternate HTML elements. The CheckBoxField, for example, renders as a checkbox whose checked state depends on the value of a specified data field; the ImageField renders an image whose image source is based upon a specified data field. Hyperlinks and buttons whose state depends on an underlying data field value can be rendered using the HyperLinkField and ButtonField field types.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend