WPF Devexpress 18.2 Grid /Tableview Paste pastes only 242 columns - wpf

I am using a WPF Devexpress GridControl with dynamic columns generated. UI Rendered all columns one column per month from years(let say 2020 to 2070). So I am trying copy values for a row from excel which has values from 2020 to 2061 which is approximately 500 values/cells. But the default TableView.OnPaste() only copies 242 cells. I tried various ways to figure out why is that? But no use.
I disabled virtualization, tried to scroll all the way to make sure columns are rendered everything is there and another interesting thing is:
TableView Evnent: ClipboardRowCellValuePasting=void OnClipboardRowCellValuePasting(object sender, ClipboardRowCellValuePastingEventArgs e)
this event is called for all 500 cells but after 242 cells the values are blanked. So its definitely in the paste implementation it is setting values to null after certain limit.
So can anyone suggest how to fix this?

Answer from Devex
To avoid this shortcoming, it's necessary to change the clipboard source priority using the SourcePriority property as follows:
ClipboardSourceFactory<ColumnWrapper, RowBaseWrapper>.SourcePriority = new ClipboardSourceType[]
{
ClipboardSourceType.XMLSpreadsheet,
ClipboardSourceType.Excel,
ClipboardSourceType.Csv,
ClipboardSourceType.UnicodeText,
ClipboardSourceType.Text
};

Related

How could I interactively create an invoice and preview it on WPF?

I'm creating a trial project wherein my window has two grids, left grid is sort of a table that has labels and textboxes each row and asks for a specific part of the invoice like item, name, address stuff like that and the right grid is to show a preview of the invoice that the left side is creating.
I thought about using a document viewer on the right side but I thought that anything I open there would be static and if I put values on the textboxes on the left grid, it wouldn't matter since I opened a standalone document to view on the right grid.
I thought about just creating a table out of the right grid and have the default values and populate the other ones when a user types something on the textbox and make it function as the preview but then I don't know how would I go about and printing it and also, it has about 45 rows which I couldn't fit in the grid without it being unreadable (because I had to cram 45 rows of data inside that small grid)
So is there a tool in the toolbox that could potentially create a interact-able grid? I tried the grid control but I can't seem to only make it show 4 columns because that's all I need, I don't want it to show E and the rest of the alphabet because I want it to resize accordingly with only 4 columns to make it more readable.
Oh and I also have devexpress installed so you guys could also recommend something I can use from there. Thank You.
I think this is the best solution since it does what I wanted it to do.
I created a scroll view and placed a grid inside it then set the length accordingly to show it in a reasonable size and let the scroll bar do its magic for me to see the rest of the grid without compromises of the content's size.

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.

Having issues with Infragistics column resizing

I have a grid and I would like to automatically resize the columns. I'm running into inconsistencies when using different parameter values for PerformAutoResize(). When passing in the values below, where the true means include column headers:
PerformAutoResize(PerformAutoSizeType.VisibleRows, true);
some columns will be resized based solely on the header, while others will resize properly based on both the header and the row values.
However, if I hardcode in a value:
PerformAutoResize(20);
It works fine for every column.
Why is this?
UPDATE
Through some trial and error I've come to the conclusion that I think the issue is that I bring in the data and then have it auto-sort by a certain row. When using a hard coded value, it appears to auto-size the columns after that initial auto-sort, whereas when I use PerformAutoSizeType.VisibleRows it appears to auto-size the columns before the initial auto-sort.
Does PerformAutoResize(PerformAutoSizeType.AllRowsInBand, true); give you the results that you are looking for?
If so then is it possible that when you make the call that the row that you want to size the grid by isn't visible?

displaying data in table format without using DataGrid/ListView/Table in wpf

I need to display data in the UI in a table format. I am using wpf (MVVM), VS 2010 and windows XP. I do not want to use the DataGrid or ListView. How can I achieve this?
What I have tried
Method 1:
I tried to use SharedSizeGroup but that didn't work. The main problem with using SharedSizeGroup is that even the row height is shared among all rows.
Method 2:
I tried to use UniformGrid but I was not completely successful. Using UniformGrid will not suite my application because each column data is of different width and I do not want each column to take the same width as the Max of all!
Can anyone please tell me how to use the normal grid to get the desired result? Is there any way to use SharedSizeGroup so that only the column width is shared but not the row height and each row occupies only desired space (i.e. same behavior as setting the height to auto) but not more than that?
Additional information: This grid has to be read-only and no row should be selectable in the UI.

Setting the background for cells with errors on selected row in Infragistics UltraGrid

I am working in WinForms with Infragistic's UltraGrid control. I want to make it so that my activated row shows cell's which have errors using a different background color than the rest of the row.
Currently, if the row is not activated, I see the errored cells with a red background, and the validated cells having a white background. However, when I select the row and it is activated, I cannot see which cells have errors any longer as the whole row has it's background set to yellow.
What I want to see is, that if the row is activated, all valid cells are yellow, and all invalid cells are red. If there are no invalid cells, then all cells are yellow.
Currently, I am de-activating the row if it is found to have an error. This works as long as the user doesn't click on the row again, which is a pretty lame assumption. I've looked into DisplayLayout.Override, which allows me to override at grid, band, row, column, and cell level, but when I override at the cell level it seems that the settings at the row level are still taking precedence.
Infragistics support suggested taking advantage of the ActiveAppearance and ActiveAppearanceEnabled properties on the cell itself, however, I'm stuck with an earlier version of Infragistics in which those properties were not implemented.
In the end I had to implement a custom draw filter for the cell using the IUIElementDrawFilter class. Examples of implementing IUIElementDrawFilter can be found at http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.1/CLR2.0/html/Infragistics2.Win.v12.1~Infragistics.Win.IUIElementDrawFilter.html.

Resources