Merging DataGrid Cells (Row Wise & Column Wise) - wpf

This question might have beebn asked earlier but i have not found ne solution....
How can i merge Two(or More) Cells in WPF DataGrid...
I have found no in built provision to do it, also i doint even know how to start
this link shows some light but still no luck...
What i wish to do is i need to Merge Two Cells of a Particula DataGridRow/DataGridColumn based on some value (It can be ne thing) Just like we Do in Excel (merging cells)

Have you considered doing cell templates for that cell in the row? If you want the same pattern repeated, that's an idea. You can use stack panels to align things as you need them.

Related

WPF WrapPanel, but fills empty space due to different size items?

I have a list of "Group" objects, each of which contains a list of "Option" objects, that show up as checkboxes. I want these to be displayed in a condensed fashion automatically without me having to layout the UI manually with something such as a Grid (which is what I've done in the past, and takes a lot of effort).
My groups have varying numbers of options, so the size of the container for the group is not the same across groups. I'm using a WrapPanel, but it leads to a fairly ugly design because each item in the WrapPanel appears to be slotted into the same size container:
I know I've done this in HTML/CSS/JS, where I can have it automatically condense the unused space. Is there something like this for WPF? My list of options is manually created, but I can add/remove options fairly easily in my code, so I would rather not have to manually recalculate things in a grid view.
I've looked at Is there any way to occupy blank space in WrapPanel automatically?, which sounds similar, but the answer to that question does not have an example and I could not figure out what I was actually supposed to change/use in the answer (my attempts using it did not make any difference at all to layout).
I guess you use Horizontal Orientation of WrapPanel, so every row have height as the maximum its element. Your problem isn't free space in the ends of rows, so the solution that you mentioned doesn't work for you. You can try to use Vertical orientation of WrapPanel, your wrappanel' elements look like they have similar width, possible it would look better.

Need to provide spaces between cells in UITableview in ios

I need to provide space between cells in UITableview.And I am also posting an image which consists of here two cells.I have gone through previous posts,but I am unable to find a suitable answers.
Thanks coders
There are several ways to achieve this, and none as simple as you may expect, the two ways that come to my mind right know are:
Define your custom cell to add an space on bottom by playing with the foreground background. If you dont need the space (for instance at the last cell) resize the cell to hide it.
Use a grouped table with one section per cell so you can use that section as space

Dynamic columns on WPF

Assume we have a DataGrid like this :
First column is constant. others are come from database. In columns we display name of football players for example and below them we display some statistics about them .
What control do you suggest to use ?
If you suggest DataGrid how do I create columns and rows and connect them to data source ?
Any code example would be appreciated.
The functionality you are looking for is typically called a pivot table or Matrix. See Dynamic data matrix WPF for an example of how to do so in WPF.
Edit: If you are not trying to pivot, but just rotate it 90 degrees, there is a rather good answer on how to do that, too: WPF horizontal DataGrid. Basically just use a couple of LayoutTransforms to rotate the whole thing, then another set to rotate the cells back to normal.

FixedColumn in StringGrid

It is possible to fix for example only third row in StringGrid?. StringGrid have property FixedColumn but you can start fixing columns only from the begining.
tnx!
TStringGrid does not natively support that, no. But you can owner-draw the cells to make them look like fixed cells, at least.

Any 3rd party Table like controls for WPF?

I know about Grid. What I don't like about Grid is that I have to specifically index every single row and col. So afterwards, if I want to just move one row or col, I have to go update a ton of xaml.
I tried stackpanel and styles but then even this is a lot of redundant xaml and rearanging the screen still involves then removing/updating styles.
I really like how in an html table, I just start laying out my rows and cols on the fly. If I want to move a row, that's easy, I can just copy paste the xaml to the right spot, nothing else needs to get touched. A col, is a bit harder, but still can be done easily with cut/paste, just needs to be done to every row.
With grid, one may need to touch every single thing in it depending on what's moved.
And what would be really cool, is if one could declare the column width and row heights up above just like a grid. But then as need, provide override values in the actual row,col declaration down below that actually contains the gui elements.
Does anything like this exist?
I've seen implementation of a Grid that infers ColumnDefinitions from usage of attached properties. Its definately doable. You could create an attached property that signifies that this element is the last element of a row.
(See WrapBreakPanel in Pro Silverlight 4 in C# By Matthew MacDonald)
And what would be really cool, is if one could declare the column
width and row heights up above just like a grid. But then as need,
provide override values in the actual row,col declaration down below
that actually contains the gui elements.
Sounds like this could get confusing. What if multiple cells in a row override the height? You can pull this off already with Auto sizing a row and having elements take up more space as needed.

Resources