Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Wonder if someone can help me,

I'm in the process of building a Windows application using WPF (with C# 2010)

Because I'm using the RibbonWindow - my entire UI is running in a Grid - which I beleive I must do owing to the Ribbon

In the process of building my UI - I've encountered an issue.

My UI looks very similar to Outlook 2007 - as such, I have a Ribbon Toolbar, underneath this, in a new Grid Row, is a Treeview control on the left hand side of the screen. I have this row of the Grid with two columns.

My issue now comes, I want the User to be able to select items in my treeview displayed on the lefthandside, and dynamically display controls/content in the Right hand window (or the second Grid column). Is there a User Control I can place in the Grid Column to do this?

In the Outlook UI - if the User selects Inbox - the middle column of the UI displays the Users list of emails. If the User then changes and selects Calendar, the UI then removes the List of Emails and replaces this with the Calendar list. This is the kind of functionality I am trying to acheive using WPF. I have no doubt this can be done - but am new to WPF so am still getting used to general UI design and layouts etc..

Any guidance on this would be greatly appreciated

Many thanks for your help in advance
Dan
Posted

1 solution

Of course, you can put an Usercontrol anywhere in the Grid.

Say you want to place the Grid at Row 1, Column 1, on SelectionChanged of Tree node, use :

yourGrd.Children.Add(yourusercontrol);
Grid.SetRow(yourusercontrol, 1);
Grid.SetColumn(yourusercontrol, 1);



This will work. Your usercontrol will be placed on correct location.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900