DataGrid that also supports a tree view [closed] - wpf

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Do you know of any datagrid-like control that also supports a treeview. Like this (but still fully WPF-stylable/templatable):
Update: UI-virtualization would be another important feature.

Telerik has a TreeListView control - http://www.telerik.com/products/wpf/treelistview.aspx. It's not free, but I think it'll do what you want.

It probably wouldn't be that hard to create your own from styling a regular DataGrid w/ Groups to look like that. The extra advantage is things like sorting and resizing columns are already taken care of.
Just style the Group Templates to contain the +/- button, folder, and group name, and change your regular DataGrid style to contain a white background with no grid lines. Even the Lines wouldn't be that hard to do if you wanted them
I always find this site useful for figuring out the different DataGrid components

You may look over this Hierarchical Data Library or this PropertyGrid control or this DataGrig control or this xamDataGrid control.
Or Look over this TreeGridControl you may set property of colomn IsReadOnly to False and edit it to WPF(its simple).
Or you can make your own control, for example whith help of this "TreeView+DataGrid in XAML" article, in which you should change TextBlock to TextBox, and make some other changes. Or whith help of this "WPF TreeListView Control" article and comments to it.

This control is somewhat similar to your request: http://www.obout.com/grid/aspnet_master_detail_self_reference.aspx
They also have this linked tree/grid example: http://www.obout.com/grid/tree_grid.aspx

Related

Wpf custom control for cinema, stadium or hall [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've got a task to create in wpf control as close as possible to this one
from the link (please click "Select Tickets" tab to see a control)
I'd like to ask for any advise where to start from?
Should I use canvas? If It's not a canvas, How to use zoom?
There are many answers for this question. At first sight, I would try to follow the next steps :
Create a control for the dots -> A circle (Path) which has a dependency property for its color.
Create a dynamic Grid with the number of columns and rows that you want and insert in every cell the control that you`ve created in the first step with the right fill color.
The zoom should be achieved by adjusting the number of columns and rows in your dynamic grid.If the number of columns it is reduced, the custom control will be stretched and will appear as a zoomed region.
Keep in mind that you have to use ObservableCollections and TwoWay Bindings in order to get the updates on the UI.
Hope it helps! Good luck
You can use a ViewBox to enable the control to size to the available space.
#Dragosh's answer is a good option. But there are often seating layouts that are not a grid. I would recommend creating a custom ItemsControl that binds to a collection of 'Seats' that have properties outlining their Section, Row, etc. and location. That way you can create a DataTemplate and ItemStyle that places the seat control at the correct location.

New to MVVM: how to workout the View [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I've just got 3 classes: Topic, Example and Exercise. Topic is the main class where both Example and Exercise is linked to. In my window (non-MVVM) I am populating a listbox with my topics, and upon selecting an item in the listbox where the topics are bound to, I am getting the ID of that topic and again populating 2 listboxes (for examples and exercises) related to that topic.
As I am new to MVVM and still trying to understand it, I am at lost on how to convert this to MVVM. Should I have 3 views (3 usercontrols?) for each 3 classes (models)? In my current setting they are all in 1 window.
This is entirely up to you.
How do you normally split state and behavior across classes? There is no 'extra' rule for that in MVVM.
Think of reuse and single responsibility. This is applicable for View, ViewModel and Model classes.
It is possible to compose a View, ViewModel and Model out of multiple classes.
One thing I learned is that although it is possible to reuse a ViewModel for multiple Views (in fact some introductions to MVVM state that as benefit) I found that in general Views tend to change after a couple of releases and you'll quickly need to create a separate ViewModel for each View. Again, this is not a requirement of MVVM; it is good old object orientation.

Ideas for alternative context menu layouts [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm trying to, find / come up with, a cool alternative to the old trusty rectangle-list-o-buttons context menu. I have seen some suggesting laying the item out circles in a circle, and they call it a pie-menu. And as you click a circle, it expands to have items around it etc. See this article.
My goal is to be able to pack a huge amount of GUI onto the context menu, without it seeming like a monster popping up every time you right click.
Has anyone ever seen/used a non-standard context menu they really liked? I'm thinking there might be some great examples from games.
This is more a warning than an answer, I'll just post it here because it's too big to fit in a comment.
Be careful with non-standard UIs. For a game, you probably have a bit more leeway.. but check out this article (item 3, specifically) from 1999.
The other warning I'll put out is be careful about putting too much in the context menu.
It is supposed to be context-sensitive. If you right-click on something, you expect actions for that item you're clicking on, and not a ton of other stuff.
I hate the fact that Macs don't have right-click by default, but I do actually agree with the supposed original intention (I can't find a reference now, unfortunately): that right-clicking should be a secondary way of accessing items. There should always be another more obvious way of accessing functions (even if it takes longer). Right-click is a shortcut for power users, not the primary mechanism.
It would be helpful to know how many different options you have, and what kind of nesting you can have (eg, is it 20 commands, each 2 or 3 categories deep with 3 or 4 top-level categories? Or is it 400 commands, with 3 top-level categories?).
I'd also suggest, depending on how many, that you try to solve this a different way: don't look for the UI to fit, but consider how you can re-factor your requirements so an extensive UI for hundreds (?) of commands is not needed.
In Crysis, there is a right-click pie-type menu, but when you invoke it, you are selecting one of 3 or 4 options : but there is no cursor - you move the mouse in the direction of the item you want, it highlights, and then you let go of the click. This is a very fast way to select items, hard to mess up, and reasonably intuitive.
You could extend this with the idea you posted, where when you select an option it keeps drilling down to more pie menus, until you get the option you want. If it's actually a non-game app, you may want to not require the right button be held down, but still removing the cursor so only the menu items can be selected may be quite helpful.

SelectedCells.Count and SelectedCells[0].RowIndex

In WinForms it is such a thing like:
if (dataGridViewControll.SelectedCells.Count > 0)
EditorForm.ID = dataGridViewControll.Rows[dataGridViewControll.SelectedCells[0].RowIndex].Cells[0].Value.ToString();
Does anyone knows how to do such tricks in a WPF Grid? I mean SelectedCells and SelectedCells[0].RowIndex].Cells[0].Value.
Of course that is possible, but the property names and techniques vary and depend on which grid you decide to use. Infragistics does it, as far as i remember it. Was that your question?
However, please bear in mind that the WPF Grid is not a data grid but mere a control for structuring your layout. Therefore i assume you refer to some other grid control?
edit: Wait, that question is years old, why did it pop up under news?

Is there a wizard control in WPF? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Are there any wizard type controls in WPF? I need functionality where I can go forward and back and use tabs to select a particular item which will show the details of the nested items. I can use the TabControl control but the tab items are dynamic so I cannot nest the region inside the tab item.
WPF has a navigation infrastructure built in:
WPF Navigation Overview
Also check out the wizard sample
Another simple way I have used for a basic Wizard is to use multiple Grids and change the Visibility properties when the buttons are clicked, using an int to keep track of the 'step number'
<Grid Name="Page1">
<TextBlock>Page 1</TextBlock>
</Grid>
<Grid Name="Page2" Visibility="Hidden">
<TextBlock>Page 2</TextBlock>
</Grid>
Check This link. you can create wonderful wizard using extended wpf toolkit.
You may try open source Avalon Wizard.
Found this great example on codeproject that should give you everything that you need:
http://www.codeproject.com/Articles/31837/Creating-an-Internationalized-Wizard-in-WPF
MVVM Wizard - Usage like this (Requires DI container, views are created on first navigation)
<controls:Wizard>
<controls:WizardStep ViewType="{x:Type test:View1}" />
<controls:WizardStep ViewType="{x:Type test:View2}" />
<controls:WizardStep ViewType="{x:Type test:View3}" />
</controls:Wizard>
or like this (no DI is required, but creates all views straight away)
<controls:Wizard>
<controls:WizardStep>
<test:View1 />
</controls:WizardStep>
<controls:WizardStep>
<test:View2 />
</controls:WizardStep>
<controls:WizardStep>
<test:View3 />
</controls:WizardStep>
</controls:Wizard>

Resources