Vaadin Table with IndexedContainer column size issue - width

I extended IndexedContainer to be used with a paginated Table. The Table is set with undefined size (so does the upline hierarchy) so when it is first rendered, i.e. page 1, all columns have their width computed dynamically, which is fine.
When switching to another page the custom IndexedContainer reloads a new set of items and these are successfully picked up and rendered by the Table. However, the Table does not adjust the column widths according to the new set of items. Basically, the column widths are exactly the ones computed dynamically for page 1..
I've been trying to fix this by manually:
setColumnWidth(..., -1) on all columns
setSizeUndefined(), again, on the Table
setWidth(-1, ...) on the Table
marksAsDirty(Recursive)() on both the Table and UI
but nothing worked as expected.
Any thoughts would be appreciated.
(Also posted at https://vaadin.com/forum#!/thread/4015043)

As suggested at https://vaadin.com/forum#!/thread/4015043 there is an experimental alwaysRecalculateColumnWidths boolean flag within Table to overcome this issue (column resize on item set change). The flag is protected, initialized to false and doesn't have a setter yet so one needs to extend Table to set it true.

Related

Hiding Tablix in SSRS report using Expressions

I have a report in which there are two tables from the same dataset, and i want to hide second table when the report runs at first, then when i click on the Product id i want to display the second table
Anyone help?enter image description here
I'm not sure you can do this by clicking on a textbox within a table as it might be out of scope, but if your first tablix is just a single line then you could just use a series of textboxes to emulate the 1st tablix.
Once you have done this, set the ToggleItem property of the 2nd tablix to be the name of the textbox that contains the ProductID.
I've just tested this and it works as expected.
...and if that does not help...
If your 1st tablix shows mutliple rows, you might want to consider adding a second row to it with the columns you require from your 2nd tablix and setting the toggleitem property of the 2nd row.

Kendo UI For Angular2 - Grid Row Select

I have a working <kendo-grid> component with 10 visible rows over a data set of 34 rows (approx 4 pages). Sorting and selecting is working as expected.
<kendo-grid [data]="gridView"
[pageSize]="pageSize"
[skip]="skip"
[pageable]="true"
[height]="300"
(pageChange)="pageChange($event)"
[sortable]="{ mode: 'single' }"
[sort]="sort"
[selectable]="true"
(sortChange)="sortChange($event)"
(selectionChange)="selectionChange($event)">
Say I select second row. Then I sort the table and the selection stays on row two but of course it's highlighting a different record. It's always selecting the second row on the grid, which of course, it's what I want.
How do I clear the selected row in my (sortChange) event so at least the user isn't presented with a different selection that they one they already chose. I am open to some kind of data binding attribute for selected row that I could set to null or some property on gridView or even poking around inside #ViewChild .
Any help would be appreciated.
Normal Sort
Ascending Sort
Descending Sort
I had a similar question here: Select grid row item from code
Basically, you also need to select the grid row item from code without user interaction and this is currently not supported in the current beta build of the Kendo UI Angular2 controls.
In my application, I resort to triggering a click event on the row I want to select. :/
I do this in a case where I have 'up' and 'down' buttons to rearrange the grid and want to maintain my selection when I switch items.
var grid = document.getElementById('myGrid');
var rows = grid.getElementsByTagName('tr');
rows[idx].click(); // add one to the desired row index to skip the header row
Here's a (sloppy, minimal) Plunkr of this scenario: http://plnkr.co/edit/09dlqdl0Xchoy0e5zKRq

SSRS won't expand the row height when exported to Excel

I have a report I am doing with SSRS 2008 with some rows that have multiple elements inside them. On the preview the row automatically expands to support the extra elements but however when I export the report to Excel it appears only as a single row with just the one element displayed, although all the elements are there when I double click the row or manually expand it.
I've checked everything...Can grow is set to true and the properties on the text box allows it's height to increase however it seems to ignore these.
Here it is in the preview
http://tinypic.com/r/b4wbdg/8
In Excel
http://tinypic.com/r/r084g3/8
Sorry about the links to the pictures and not in this question
Both CanGrow and CanShrink properties should be set to false. There is nothing like CanGrow and CanShrink in Excel. By setting them to false it will display the height as it is. Otherwise it will set the height to a default value.
This worked for me. Check this Row height not preserved when exporting to Excel thread for more suggestions.
Came across this (again) recently and thought I'd share my take...
Whether Excel correctly renders the height has to do with merged columns. Take note of your column alignments throughout all objects on the page. Any objects not tied to the data table itself (or embedded inside the data table) must be aligned with the columns of the table in question, at least for the cells that need to wrap text. If there is any overlap causing the table columns to be split and the cells of wrapped text to be re-merged, Excel will not recognize the row height by either setting the CanGrow to True or snapping the row to fit within Excel.
In the original post, the user mentioned rows with multiple elements inside of them. It is possible that those elements caused the column to split for the surrounding subtotals or adjacent groups with wrapped text.
Setting the CanGrow to False will simply prevent any automatic sizing of the row height by default for both the web view and Excel export, so I don't know if that's the ideal solution to this problem.
Both CanGrow and CanShrink properties should be set to false
This must be done for all cells in the row of the Tablix!!
Otherwise the data is not properly exported.
reduce the widths of the rows and it fixed my problem
I remove the header of the report, and all works perfectly.
I have other reports and I see now that if I remove the textboxes that are included on the sheet when exporting to excel, then the row heights in excel are sized properly.
I know this is an old question but I've been struggling with it. My issue was that I had a second field in a column where I inserted a placeholder underneath the field in the column. When exporting to Excel I wanted it to be tall enough that the second field would show underneath the main field in the column.
To get it to work for me, I inserted a blank column next to it and made it just wide enough for a single character. Then I click and hit enter several times to force it to be multiple lines. When I export, I have a blank column but otherwise it worked for me.

How to prevent a viewPanel with category filter showing empty rows if filter is not set

I'm having this categorized view displayed in a view panel where the category column itself is not shown. Instead I'm displaying a combobox above the viewPanel where users can select from all the categories available (see screenshot below). The combo is bound to a scopeVariable and is refreshing the viewPanel onChange. The viewPanel has a computed categoryFilter reading from the same scopeVar. That all works nicely.
Now I also have implemented an additional wildcard (*) value in the selection list which (if selected) programmatically sets the cat filter to NULL. This way I'm forcing the viewPanel to show all entries. Again, this works fine, but with the drawback that now the view is showing empty rows where the category entries would be shown normally (in the screenshot you see empty rows above each entry, with 2 entries for the category "edcom GmbH" obviously belonging to the same category; those aren't separated by an empty row):
One way to at least hide those empty rows would be through means of css coding. But I would prefer those rows not being rendered at all.
Can this be done at all using a viewPanel, and how? Or do I have to use other controls like a repeat or a dataTable maybe?
Thanks in advance,
Lothar
One "hack" (an ugly one I admit) would be to change your categorization column from Firma to Firma:"--All--" or Firma:"*" and then instead of setting the category filter to NULL you set it to "--All--" (or "*").
The double category hits the indexer, but should do what you need.
Obviously there's no easy way. So meanwhile I'll stick to this css-style solution:
In the view panel und All Properties - data I set var = "entry". Then, under All Properties - styling I set a programatic value for the rowClasses property:
if(entry.isCategory()){
return "rowStyleHidden";
}
return "";
The style class "rowStyleHidden" hides those rows using
display: none;
Don't know yet how this turns out performance-wise, I'll have to observe this once I implement it in a copy of the real database.
You can also switch to a none categorized view, by having the viewname calculated based on the value in combobox.

How to create dynamic size columns in C# .net 4.0 using TableLayout in WinForms

I want two rows and first row has two columns. But I do not found any property by which I can set size of column. I place toolbar in first row and first column. I want to hide it progemmatically. So, how to design UI by using TableLayout?
Use the ColumnStyles property:
tableLayoutPanel1.ColumnStyles[0].Width = 0;
Not so sure that makes sense, every control in the colum will get hidden and the other columns will grow proportionally. Hiding a control is otherwise simple, just set its Visible property to false.

Resources