We hope these clues can help you, in case you encounter a problem during the activation. As mentioned before, please contact support, if the issues persist.
]]>1) The intuitive approach on getting started
The good thing is, you can get started right away. Due to the build-up of processes, as well as the well documented procedures you have almost no learning period. Component Owl keeps its design close to the original .NET ListView so you do not have to get acquainted to a completely new system. But still, the changes made are substantial enough to make your working routine so much easier. Whether its the inbuilt drag & drop, the sub-item images or the multi-column sorting, the processes are meant to make your life easier.
2) The fast and helpful support
As Component Owl has been on the market for quite a while now, it has been further developed and improved countless times, resulting in a detailed and meaningful FAQ which answer to the majority of your questions. In case you cannot find the answer you need, you can rely on our support system which will give you feedback on you request within 24 hours. This allows you to keep the workflow going with almost no interruptions and puts you ahead of the freeware users.
3) The possibility to customize
Just like every developer has his own style of working, Component Owl can be customized to every user needs. The many opportunities to adapt your surface to your favorite design or to arrange the necessary tools the way you need them, allows you to optimize your workflow to perform even better.
These 3 named advantages are just a few of the many that Component Owl offers you. For more infromation just check out our trial version to see for yourself.
]]>Today, our blog post covers an interesting case when using Internet Explorer.
When instantiating an ActiveX control written as a .NET assembly exposed via Interop you might get the following message:
System.IO.FileNotFoundException("Could not load file or assembly 'BetterListView, Version=3.8.2.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx' or one of its dependencies. The system cannot find the file specified.")
The solution to this problem is a fairly simple one, quoting from an MSDN article:
“… you can install it in the global assembly cache so that it can be activated from any COM client. If the assembly is only going to be activated by a single application, you can place it in that application’s directory.”
Concluding from this short excerpt, you are basically left you with two options:
1) You may register BetterListView in GAC if it is to be shared. But you should be careful with GAC because it allows holding multiple versions of the same assembly. You can make the installer remove any older versions from GAC during installation and add/keep just the newest one.
2) You can put your .net assembly with all third-party DLLs in one directory during installation if it is to be private.
We recommend the second solution as we reckon it to be the safer one.
]]>
Centered images in Better ListView
Better ListView 3.11 supports aligning images in sub-items and columns to center. Simply set AlignHorizontalImage property of an sub-item or column to BetterListViewImageAlignmentHorizontal.OverlayCenter.
The image will be centered inside available space regardless of text.
This is useful for sub-items and column headers consisting of image only.
]]>
Better ListView Sub-item Check Boxes
Better ListView 3.10.0 allows displaying fully interactive check boxes and even radio buttons in sub-item cells.
This feature can be activated simply by setting CheckBoxAppearance property of a given sub-item to other value than Hide. Such sub-item will not display check box or radio instead of image and text.
Please note the first sub-item’s properties do not apply as they are overriden by item’s properties. These two are separate for the case of column reordering (keeping consistency of sub-item states).
Another new feature in Better ListView is that check boxes or radios can be displayed disabled. This can be achieved by setting CheckEnabled property to false on the respective item or sub-item.
Sub-item check boxes can be operated by both mouse and keyboard. Checking sub-item with keyboard can be done by navigating focus rectangle by arrow keys to the given sub-item and pressing spacebar.
]]>
Default list without grid lines below items
Setting grid lines in Better ListView is easy. Simply make sure you are using Details view (the default view). Then you can set GridLines property to one of the following values:
None of these settings, however, cause drawing lines below the last visible item, which may be desirable. The reason for this is that Better ListView supports custom item height and there is uncertainity about the spacing between new grid lines (smallest?, largest?, average?) It is up to your choice.
To draw new grid lines, handle the DrawBackground event (or subclass BetterListView and override the OnDrawBackground method) with the following code:
[csharp gutter=”false” toolbar=”false”]
private void ListViewOnDrawBackground(object sender, BetterListViewDrawBackgroundEventArgs eventArgs)
{
BetterListView listView = (BetterListView)sender;
// get last visible item
var item = listView.BottomItem;
if (item == null)
{
return;
}
// measure row height
var bounds = listView.GetItemBounds(item);
int rowHeight = bounds.BoundsOuterExtended.Height;
// draw additional lines
Rectangle rectClient = listView.ClientRectangleInner;
Pen penGridLines = new Pen(listView.ColorGridLines, 1.0f);
int y = (bounds.BoundsOuterExtended.Bottom + rowHeight);
while (y < rectClient.Bottom) { eventArgs.Graphics.DrawLine( penGridLines, rectClient.Left, y, rectClient.Right - 1, y); y += rowHeight; } penGridLines.Dispose(); } [/csharp] What this code does is getting the last visible item using BottomItem property. It is important to get this visible item instead of e.g. first item because GetItemBounds method returns non-null value on visible items only. The GetItemBounds method reveals item measurement which is used to determine item height and coordinate of its bottom. Finally, we draw new lines using current grid line color (ColorGridLines property) until reaching the bottom of the view.
]]>
Alternating Rows
Lists with alternating row colors are more readable. It is very simple to implement alternating rows in Better ListView.
Simply add DrawItemBackground event handler and fill background on odd/even items:
[csharp gutter=”false” toolbar=”false”]
private void ListViewOnDrawItemBackground(object sender, BetterListViewDrawItemBackgroundEventArgs eventArgs)
{
if ((eventArgs.Item.Index & 1) == 1)
{
eventArgs.Graphics.FillRectangle(Brushes.AliceBlue, eventArgs.ItemBounds.BoundsOuter);
}
}
[/csharp]

Search Filtering with highlight
There are few ways of making searching in large list of items more convenient. For example, Better ListView provides Search Highlighting and Item Hiding features that can be used to improve searching. The above animation shows both of these features in action when searching for a word “pear” using keyboard.
The implementation is very simple and involves handling just two events: ItemSearch (raised whenever item is searched, e.g. using keyboard ) and KeyDown:
[csharp gutter=”false” toolbar=”false”]
var listView = new BetterListView();
listView.Items.AddRange(new[] { “apple”, “pear”, “pineapple”, “orange”, “grapefruit”, “cherry”, “avocado” });
listView.ItemSearch += listView_ItemSearch;
listView.KeyDown += listView_KeyDown;
[/csharp]
The ItemSearch event handler finds matching items and sets their visibility accordingly. It also updates the highlighting:
[csharp gutter=”false” toolbar=”false”]
void listView_ItemSearch(object sender, BetterListViewItemSearchEventArgs eventArgs)
{
var listView = (BetterListView)sender;
listView.BeginUpdate();
// update item visibility according to search query string
foreach (var item in listView.Items)
{
bool match = item.Text.Contains(eventArgs.QueryString);
if (match)
{
item.Visible = true;
item.SearchHighlight = new BetterListViewSearchHighlight(
0,
item.Text.IndexOf(eventArgs.QueryString, StringComparison.Ordinal),
eventArgs.QueryString.Length);
}
else
{
item.Visible = false;
}
}
listView.EndUpdate();
}
[/csharp]
Finally, the KeyDown event handler resets the view when Escape key is pressed (all items are made visible and the highlight is removed):
[csharp gutter=”false” toolbar=”false”]
void listView_KeyDown(object sender, KeyEventArgs e)
{
var listView = (BetterListView)sender;
listView.BeginUpdate();
if (e.KeyCode == Keys.Escape)
{
// remove search highlight
//NOTE: we could use BetterListView.RemoveSearchHighlight() but this applies to visible items only and some items are hidden at the time
foreach (var item in listView.Items)
{
item.SearchHighlight = BetterListViewSearchHighlight.Empty;
}
// make all items visible
foreach (var item in listView.Items)
{
item.Visible = true;
}
// mark the key as handled
e.Handled = true;
// suppress KeyPress event to prevent ItemSearch from happening
e.SuppressKeyPress = true;
}
listView.EndUpdate();
}
[/csharp]
And that’s it!
]]>
Better ListView custom scroll bar size
Better ListView 3.7.0 contains two new properties that allow you to set custom horizontal and vertical scroll bar sizes:
Of course, you can set these custom sizes in design-time as well as in run-time.
Larger scroll bars are practical on modern touch-enabled devices with high resolution screens. The default scroll bar size (17 pixels) may be too small and you may want to make it just large enough for your index finger.
This features works in both Better ListView and Better ListView Express.
]]>
I found the effect of fading borders impressive on my smartphone. This is actualy very easy to do as it requires a simple gradient brush.
You can obtain the same effect with Better ListView by overriding the DrawingRedrawCore method and do the drawing over the items:
C#
[csharp gutter=”false” toolbar=”false”]
public class FadedListView : BetterListView
{
///
private const int FadingSize = 64;
public CustomListView()
{
// this is required because we will draw outside item boundaries
OptimizedInvalidation = false;
}
protected override void DrawingRedrawCore(Graphics graphics)
{
base.DrawingRedrawCore(graphics);
// get boundaries of items (this excludes column headers and scroll bars)
Rectangle rectContent = BoundsContent;
// get size of the gradient
int fadingSize = Math.Min(
FadingSize,
rectContent.Height >> 1);
// get boundaries of the gradents
Rectangle rectFadingTop = new Rectangle(
rectContent.Left,
rectContent.Top,
rectContent.Width,
fadingSize);
Rectangle rectFadingBottom = new Rectangle(
rectContent.Left,
rectContent.Bottom – fadingSize,
rectContent.Width,
fadingSize);
// make boundaries larger to avoid rounding errors in gradient brushes
rectFadingTop.Inflate(1, 1);
rectFadingBottom.Inflate(1, 1);
Brush brushFadingTop = new LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical);
Brush brushFadingBottom = new LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical);
// deflate the gradient boundaries back
rectFadingTop.Inflate(-1, -1);
rectFadingBottom.Inflate(-1, -1);
// draw the gradients
graphics.FillRectangle(brushFadingTop, rectFadingTop);
graphics.FillRectangle(brushFadingBottom, rectFadingBottom);
// cleanup
brushFadingTop.Dispose();
brushFadingBottom.Dispose();
}
}
[/csharp]
Visual Basic
[vb gutter=”false” toolbar=”false”]
Public Class CustomListView
Inherits BetterListView
”’
Private Const FadingSize As Integer = 64
Public Sub New()
‘ this is required because we will draw outside item boundaries
OptimizedInvalidation = False
End Sub
Protected Overrides Sub DrawingRedrawCore(graphics As Graphics)
MyBase.DrawingRedrawCore(graphics)
‘ get boundaries of items (this excludes column headers and scroll bars)
Dim rectContent As Rectangle = BoundsContent
‘ get size of the gradient
Dim fadingSize__1 As Integer = Math.Min(FadingSize, rectContent.Height >> 1)
‘ get boundaries of the gradents
Dim rectFadingTop As New Rectangle(rectContent.Left, rectContent.Top, rectContent.Width, fadingSize__1)
Dim rectFadingBottom As New Rectangle(rectContent.Left, rectContent.Bottom – fadingSize__1, rectContent.Width, fadingSize__1)
‘ make boundaries larger to avoid rounding errors in gradient brushes
rectFadingTop.Inflate(1, 1)
rectFadingBottom.Inflate(1, 1)
Dim brushFadingTop As Brush = New LinearGradientBrush(rectFadingTop, BackColor, Color.Transparent, LinearGradientMode.Vertical)
Dim brushFadingBottom As Brush = New LinearGradientBrush(rectFadingBottom, Color.Transparent, SystemColors.Window, LinearGradientMode.Vertical)
‘ deflate the gradient boundaries back
rectFadingTop.Inflate(-1, -1)
rectFadingBottom.Inflate(-1, -1)
‘ draw the gradients
graphics.FillRectangle(brushFadingTop, rectFadingTop)
graphics.FillRectangle(brushFadingBottom, rectFadingBottom)
‘ cleanup
brushFadingTop.Dispose()
brushFadingBottom.Dispose()
End Sub
End Class
[/vb]