Possible to Freeze Columns in a WPF ListView/GridView? - wpf

I currently have a GridView inside a ListView.View. The GridView columns will far exceed the width of the screen, so there will always be horizontal scrolling.
What I would like to do is to have certain columns always remain on the screen regardless of scrolling. So the first x columns from the left are frozen (ala Excel), and the rest can scroll.
It does not need to be dynamic/user selected--I know in advance which columns need to be frozen.
Is this possible?

Quick and dirty solution would be to use two listviews next to each other. Left one would be for the frozen columns and right one would have horizontal scrolling enabled. If you need vertical scrolling you can wrap both listviews in a scrollviewer.

Related

How to scroll a DevExpress Xtragrid horizontally but by full columns

I want to scroll a grid horizontally. By default, it scrolls pixel by pixel. I want to scroll column by column. Simply, a column should shift to left/right 100% or 0%. Shouldn't scroll by a fraction of it's width. (This applies to the first column visible to the user at the moment).
What I want is a way to do "snappy" scroll.
How can I get this done?
To scroll grid's content, use the GridView.LeftCoord property. To access boundaries of columns, the GridViewInfo.ColumnsInfo collection will be helpful. You can see how to implement this feature in the How to implement scrolling by columns in the grid e2481 example.

How to prevent automatic horizontal scroll on cell-click in grid panel

I have a gridpanel with a very wide column using a custom renderer. The column need to be this wide.
Sometimes the user wants to scroll to the right and click elements in the rightmost part of the cell, which is normally outside the screen/view.
When clicking the cell the grid will automatically make a horizontal scrolling so that the left end of the column becomes visible. I don't want this automatic horizontal scroll to happen. I want the grid to stay where it is seeing only the rightmost part of the column.
Is there a way to prevent the automatic scrolling behavior?
The trick is to set cellFocusable to false on the column.

DevExpress XtraGrids horizontal scroll is slow. How to speed it up?

I have 11 visible grids that are synchronized - LeftCoords of children ones is set when LeftCoord of parent one changes. Those grids have around 50 columns, but it could possibly by more. When all grids are visible horizontal scrolling becomes very slow. Those grid have some customized behaviors.
Is there some grid functionality that makes horizontal scroll slower, or is it normal speed? Are there any known ways of making it faster?
I am using version 13.2.
Thanks,
Peter
You have a lot of columns in grid. I suggest you that you limit the number of columns to show by hiding unnecessary ones. If an end-user needs a particular column, he/she will be able to make it visible from the Column Chooser.
Handling any custom draw events, applying format conditions, or using unbound columns will decrease performance.
Source: Horizontal scrolling is very slow when there are large number of columns in the grid
Please increase the GridView.HorzScrollStep property and set the
GridView.ScrollStyle property to none to disable live scrolling.
Additionally, there is a request on providing the per-column scrolling
in the XtraGrid at Horizontal scrolling by a column at a time (as in
MS Excel)
References:
Scrolling speed both Horizontal an vertical

How to re-size add/remove from list controls in window's form to provide anchoring like behavior

I want to anchor below datagridviews to top, left, right & down in a way that they don't over lap when the size of form is increased or decreased. Dock and Anchor both don't seem to provide any solution for this.
You probably need to have a TableLayoutPanel handle that. Three columns, middle column is fixed (Absolute), the outside columns would be based on percentage (50% each).
The DataGridView controls would then be dock-filled into each side column.
Or just handle the layout yourself in the form's Resize event.

Spreading controls to fill space as a dialog resizes

I have a dialog with column down the right side filled with buttons. The dialog is built with Windows Forms. I have a mockup at the following link:original dialog
(I would have included it but apparently i'm not allowed to use image tags)
I would like for the buttons in the right column to resize themselves to fill the remaining vertical space when the dialog resizes. It doesn't particularly matter to me whether or not buttons simply increase in size or whether the buttons remain the same size while the gaps between them increase. I'm simply want the buttons to go from the top to the bottom. (I have a mockup for this as well but apparenlty i can only include one link)
I've tried hosting the buttons in a FlowLayoutPanel but they do not increase as the dialog stretches, I only get whitespace at the bottom after I run out of buttons. I also tried a TableLayoutPanel and had the same result but I may have misused it. Does anyone have any ideas how I could accomplish this?
Thanks in advance,
Jeremy
To get you started. Use the TableLayoutPanel, set its Anchor property to top, bottom, left, and right. Set the rows and columns to percentages as needed. I suggest each control have it own cell. Note that each control in a "cell" can have its Dock and Anchor property set as needed.
You can do this with a TableLayoutPanel. Create a column for the buttons, with each button having it's own row / cell in the column. Set each row to be an even percentage for height (if there are 10 buttons, each row would be 10%), and dock the TableLayoutPanel to the right side of the screen. Then, put the buttons into their rows and set them to full docking. Then, when the dialog expands, the TableLayoutPanel will expand to fill the entire right side of the screen, each row will adjust proportionally, and each button would expand to fit the new row size.
You may have to adjust this a bit to fit your needs, especially in how it relates to the other content in the window.

Resources