How to scroll a DevExpress Xtragrid horizontally but by full columns - winforms

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.

Related

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.

Data Grid View and Vertical scrollbars issue

I realized something annoying when using a data grid view control. When I try to set the cell's height by setting the RowTemplate height property to fit more records on the grid, the vertical scroll bar stops acting nicely and the grid doesnt display all the records (it only shows the records that fit on the available space plus one extra record!) until you resize the columns or something like that! But if I set the AutoSizeRowsMod property to AllCells the grid displays all the records, however the cell's height is now too big for me!
Is there a way to control the cell's height and still show all the records on the DGV? Does it even make sense that it's behaving this way?
Thanks

Possible to Freeze Columns in a WPF ListView/GridView?

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.

Horizontal ScrollBar in WinForms DataGridView

I'm using a DataGridView in VB.Net in VS 2005. The issue is, when there are rows that exceed the width of the DataGridView, the horizontal scroll bar doesn't appear (the ScrollBars property is set to "Both"), but an ellipsis appears at the end of each row that is too long. I don't want the ellipsis, but the horizontal scroll bar. The vertical scroll bar works as expected when the number of rows exceed the height of the DataGridView. Any ideas on how to resolve this?
I have tried setting numerous related properties (changing the AutoSizing property of the DataGridView, Resizability of the Row Template, made sure that no Columns were Frozen) to no avail.
Thanks!
Set the AutoSizeMode of the problematic column to AllCells.
This will resize the column header and force it to go out of the visible area thus displaying the horizotal scrollbar.
I just had the same issue. I had set the last column to Fill, so it was always resizing to fit to the visible area.

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