Tree-view Alternatives - c#

im currently working on a project that involves listing contacts with a photo and email address, kind of like messengers contact lists.
The problem is ListView just dont cut it!
I need something that's like the MSN Live Messenger contact lists, Witch consist of a large padded area with photo(32px), And text to the right of the photo but also have the expandable headers.
Anybody give me some advice on any references i can use or if its possible to do with Tree-view can someone show me an example.
Kind Regards.

I would recommend making a WPF user control and hosting it in in an ElementHost control in your Windows Forms project. I've used WPF inside WinForms in the past and it works great.
Assuming you add an element host control onto your WinForms called elementHost1:
elementHost1.Child = new MyWPFControl();

Are you using WPF? You could use a ListView after all with an Expander for the ItemTemplate. Blacklight also has a great AnimatedExpander: see Blacklight releases.
Hope that helps!

Related

Xamarin Android Grid control

Is there a suitable grid control in Xamarin Android, table-like, for a business app that supports databindind with collections that help altering various columns/cells?
As far as I find out, there are alternatives only by inheriting an existing control like ListView and creating a custom control.
If a control as one I am searching for does not exist, what could be the best option left?
Many thanks in advance!!
Is there a suitable grid control in Xamarin Android, table-like, for a business app that supports databindind with collections that help altering various columns/cells?
You can refer to GridView, it displays items in a two-dimensional, scrollable grid.
And this tutorial will show how to create a Grid View.

Interactive MapIcon, Windows Phone 8.1 Universal App

so, I have an app which allows users to add recommendations for restaurants and places in a certain area, when added a MapIcon is added to map and data pulled from parse, what i need is a way that when the MapIcon is clicked that is displays the information for that recommendation, another option is adding a custom user control to the map. put I would prefer the first way. Any Help would be appreciated :)
You can't make MapIcon (and other children of the MapElements collection) interactive. These are controlled by the native MapControl.
What you can do, is add normal XAML elements to the MapControls Children collection e.g. via a MapItemsControl. There you can use whatever you like. Buttons, Images with tapped handlers and so on. See http://msdn.microsoft.com/en-us/library/jj620947.aspx

Visual objects that change size in c# displayed in a linear list

Please forgive any silly words I may say. I am coming from a Actionscript3 background.
I am using "Visual C# 2010 Express".
I have a simple Form, in a WindowsForm Project, which currently holds just a Listbox. (Which I presume I will have to change to something else).
And I made myself a different display object (User Control) that is currently a Checkbox a title. (More will be added once I get over the hurdle below)
But I can't even get as far as Displaying the UserControl as a list.
I can't seem to find anywhere on the listbox to say "User this displayobject as the visual for listbox". I see tutorials saying "ItemsPanelTemplate" but I get error saying there is no such property for a Listbox.
I even tried making the Form in Design view and it is not in the list down the side of the GUI when I dragged as Listbox on screen.
Now I know how I would do this in pure Actionscript, but I dont know how to do this in Pure C#. Tutorials are not helping, as all the Microsoft site seems to try to give me is XAML (XML). and I am looking for C# code. So I have thrown in the towel and pleading for outside help.
Thank you for any help you can give.
It sounds like you want a list of items, each with a CheckBox and some descriptive text. Try using the CheckedListBox control. MSDN link.
This question also answers the question of how to do custom image drawing for each item in a ListBox. It may be helpful.
Edit after clarification:
Try embedding the UserControl in a ListView, rather than a ListBox.
References on embedding controls in ListViews:
C# listview - embedding controls
Adding button into a Listview in WinForms
You could also use a list of Panels, with each Panel hosting a UserControl.
C# List of Panels
But the real answer, as seen in the question's comments, is that Winforms doesn't have a convenient way to do this. This is a task much better suited to WPF.
You may check out freeware component Better ListView Express from ComponentOwl. It supports simple Details view without columns, two and three-state checkboxes, images and more...
They also offers full version with even more nice features like hierarchical and multi-line items.

Simpler Breadcrumb Bar Sample

my question is very simple. I am building an app(WPF CSharp) and I need user to give me paths that my app is going to use. Previously I added textboxes to show pathways, however, later I decided that it would be cool to use a Win 7 style Explorer navigation bar, which is a Breadcrumb bar. I found a great open source component for it here (http://www.codeproject.com/KB/tree/WPFBreadcrumbBar.aspx) however, I could not use it in my app. I added references both to Toolbox section and Project>References section. I can also add the control to my WPF window from Toolbox, yet I could not figure out how to fill it, how to change and show items in it etc. With respect to component author, I think article on Codeproject is not very 'understandable'(XAML? I want C# code please) and also PopulateItems event, for instance, did not work for me. So, if someone give me a basic example on how to add items to this bar easily, change items, or shortly, shows me how to make it work, I will appreciate for that,
Thanks.
I Guess it depends on how you want to present it. If you want to use a tab control to simulate the functionality you could go this route:
http://www.wpfblogger.com/post/BreadCrumb-TabControl-Style-for-WPF-40.aspx

Free Windows Forms Components Similar to jQuery UI Draggables

EDIT:
So, I ended up making my own basic solution to this problem, and it can be found in my own answer to the question below. Or, here's a link.
Original Post
I'm doing some UI programming for a small .NET application. The application has some collections of items that need to be displayed in a grid sort of format (X columns by Y rows) and the grid elements need to be able to get dragged around to different grid locations, and possibly out of the grid all together.
The most comparable sort of UI design elements I can think of are the jQueryUI Draggables.
Do I have to roll my own or are there components people have already written to act like this? Even better, are there any free components? Or is there an easy way to do this that I just don't know about (don't do a lot of .NET UI programming..)
Also these "grid items" need to be able to include windows form components. The DataRepeater control is close to what I need, except it only supports horizontal or vertical alignments, not grids of items.
Here's a visual example of what I'm looking for:
I tried to stick with a halloween theme here.
Well I rolled my own solution and hosted it on GoogleCode:
draggableitemorderedpanel- A .NET Winforms Component... Kinda like jQuery UI Draggables (not really, maybe someday)
here's a screenshot:
(source: googlecode.com)
and another just resized:
(source: googlecode.com)
Hope this helps someone else out. Also it's super basic and pretty sucks right now but gets the job done.
Anyone that wants project access can have it.
The System.Windows.Forms.TableLayoutPanel control supports dragging and dropping, you just have to handle the right events. You could make your own "GridItem" user control, with the icon, caption, background color, etc displayed on a Panel, and then plop a bunch of them in the tablelayoutpanel, and wire up some event handlers. Here's something similar:
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/1cade626-b76d-40c5-9e5a-101cf2a5e412

Categories