How to speed up autosizing columns in apache POI?

Solution which worked for me: It was possible to avoid merged regions, so I could iterate through the other cells and finally autosize to the largest cell like this: int width = ((int)(maxNumCharacters * 1.14388)) * 256; sheet.setColumnWidth(i, width); where 1.14388 is a max character width of the “Serif” font and 256 font units. Performance … Read more

How to say XAML in code behind?

For setting Height = “Auto” on most controls, you want to assign the value with double.NaN. Example: element.Height = double.NaN; Setting Width/Height = “*” ( is a slightly different matter, since it only applies to a select few elements (ColumnDefinition and RowDefinition for example). The type of the Width/Height value is GridLength, rather than double. … Read more

WPF UserControl Design Time Size

For Blend, a little known trick is to add these attributes to your usercontrol or window: xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ mc:Ignorable=”d” d:DesignHeight=”500″ d:DesignWidth=”600″ This will set the design height and width to 500 and 600 respectively. However this will only work for the blend designer. Not the Visual Studio Designer. As far as the Visual Studio Designer … Read more

How to set width to 100% in WPF

It is the container of the Grid that is imposing on its width. In this case, that’s a ListBoxItem, which is left-aligned by default. You can set it to stretch as follows: <ListBox> <!– other XAML omitted, you just need to add the following bit –> <ListBox.ItemContainerStyle> <Style TargetType=”ListBoxItem”> <Setter Property=”HorizontalAlignment” Value=”Stretch”/> </Style> </ListBox.ItemContainerStyle> </ListBox>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)