How we can grouping data-grid in silver-light with xaml?
(I used silver-light 4 )
Perhaps somebody wants to give you a hint, that you should provide some additional information so we can get an idea, what your intention is.
Is it a layout question or do you want to group data in a DataGrid?
Related
The best way to show what I need is showing an image:
What is the easiest way to implement this kind of "nested ListView" - each Item can be expanded and has subitems. I want the hierarchy only to show on the first column as shown when any other solution can be accepted.
There are couple of ways to do it. I consider that you are good in WPF and easily check code and take idea from it because it is not easy to give code of your requirement here.
You must need to user Expander for expand and collapse functionality for the detail sections as per you image.
I am sharing some the links from where you can easily get what you want. It is not exact code which you can copy but it will give you basic structure of what you want.
Listview and Expander
Sample-1
Expander and DataGrid
Sample-1
Sample-2
You will enjoy working on this one.
I am trying to achieve this.
I have a list of records (filenames) which I want to show in a list.
Anybody has any idea as to which control to use.
Regards,
Deepak
The information is right at your fingertips. You should learn to use Snoop. Aside from that, you should choose whatever control works best for you, which requires you to learn the difference between each. We can't really provide a good answer because there are many different ways this control could be implemented, and that's why WPF is so powerful.
Basically, you'll want to use a mixture of a Grid and ItemsControl. You can see the layout of the controls that are being used in this screenshot:
i have to show Text and Graphical status in one(same) column of the XAMDataGrid.
can please someone suggest me template for this.
There are two ways you can accomplish this. The first is to use a Style targeting the CellValuePresenter where you change the Template. If you are not editing the values, this is the recommended approach and there is an example in the Embedding a Custom Control in a Field help topic.
The second way to do this is to create a custom ValueEditor which is better if you need to allow editing. You may be able to use the ControlHostEditor that Andrew Smith provides in the sample in his Hosting WPF Controls in a XamDataGrid Cell blog post.
I need to display in my program number of similar statistics, like:
Name / Age / Salary / Position
John 30 1000 senior
Kate 18 100 intern
... .. .. ...
Totally I need to display several hundreads lines.
The question is what control should I use?
At least I know two options:
use Table control
use Grid layout (then dinamically add labels etc. to the grid)
I think with Grid I will automatically have "custom rendering" because I can add anything into Grid, not only "Label", but also buttons for example. However I'm not sure if I need such possibility.
But I need ability to sort the table by certain column.
So it seems "Table" better feets my needs, however I noticed that it seems that "Table" is not very popular in WPF (am I correct? why?)
So the question is "Should I use Table or there is someting better?" Is it possible to use databinding with Table?
I'm absolutely novice to WPF so sorry for any stupid questions :)
DataGrid and GridView were built for exactly that. When you bind a source it creates a table like row for each row in the source.
Either use a DataGrid or a ListView (with GridView), do not use a Grid, and what is this Table you speak of? If you mean this class, that can only be used in flow documents, which you do not need.
(See the documentation pages for examples or do some searching)
I am using EF with WPF.
How should I create a ListBox that shows both Contacts and Persons?
My question is rather how to retrieve it and create the CollcetionViewSource(s).
I know I will have to use ItemTemplateSelector, that's less what I care, what I really care is the retrieval, but any tips on the representation will be welcommed as well.
Thanks
See the CompositeCollection class.