Owl's Blog on .NET development http://www.componentowl.com/blog Component Owl codes Better ListView control all night so you don't have to. Tue, 04 Sep 2018 13:10:05 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.8 Activation issues and how to solve them http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/ http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/#respond Wed, 01 Mar 2017 17:22:52 +0000 http://www.componentowl.com/blog/?p=927 Dear Readers,
Periodically we get emails from users having problems with the activation. So we put together a check list on how to deal with the most frequent issues. In case these fixes do not help you solve your problem, please contact contact support at support@componentowl.com and we will be happy to help you out.
Below, you will find some obstacles we have stumbled across in the past.

  1. Try to rebuild the project/solution
  2. Restart Visual Studio if rebuilding the solution did not stop the nag screen
  3. If you use Better ListView in a Class Library project, it should be referenced and activated in both, the main project and the Class Library project.
  4. Do the main project (executable) and all referenced projects contain the licenses.licx file within the Properties folder? If not, rebuild the main project (executable) and copy the licenses.licx file to the appropriate location in all referenced projects (Class Library or other executables).
  5. The licenses.licx file should contain only a single reference to Better ListView with the current version number (e.g. ComponentOwl.BetterListView.BetterListView, BetterListView, Version=3.7.2.0, Culture=neutral, PublicKeyToken=e6c91a3add447be2). If there are more lines referencing Better ListView, remove the obsolete ones. You can also delete the licenses.licx file and rebuild the project to regenerate it.
  6. Run the Activator application (installed along with the product) and check if it displays a valid license (license info should be displayed in green).
  7. You can try to finish the activation via the Activator app and then rebuild the main project. The Activator allows custom proxy settings for activation from behind a web proxy (often present in corporate environments).
  8. Check, if the license-blv.dat file is present in the “C:\ProgramData\Component Owl\” folder after activation. If not, please contact support at support@componentowl.com
  9. Check, if your projects reference the same version of Better ListView as the one that is installed. Open the „Reference Properties“ window by right clicking on Better ListView reference in the Solution Explorer. Then check if there is a Specific Version property set to true. If so, remove the reference and add a new reference to Better ListView with the correct version. You can also just set Specific Version property to false.
  10. The Better ListView has to be activated on each machine where it is built. Do not copy the license-blv.dat file because this is specific to each machine. Rather follow the activation process on each machine.

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.

]]>
http://www.componentowl.com/blog/activation-issues-and-how-to-solve-them/feed/ 0
The Three Main Advantages Better ListView has Over the Classic .NET Framework http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/ http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/#respond Thu, 09 Feb 2017 21:51:12 +0000 http://www.componentowl.com/blog/?p=921 Dear Readers,
When evaluating an alternative to replace the .NET ListView you might stumble upon the question: what sets the different solutions available apart from each other? Which one meets my demands the best?
Here are the three main reasons we think Better ListView is the ideal solution for you if you are planning to use a professional alternative:

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.

]]>
http://www.componentowl.com/blog/the-three-main-advantages-componentowl-has-over-the-classic-net-framework/feed/ 0
BLV and Internet Explorer http://www.componentowl.com/blog/blv-and-internet-explorer/ http://www.componentowl.com/blog/blv-and-internet-explorer/#respond Sun, 13 Nov 2016 22:37:47 +0000 http://www.componentowl.com/blog/?p=914 As you all know we are constantly working on improving BetterListView, but once in a while you might encounter a problem which has not found its way to our documentation yet.

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.

]]>
http://www.componentowl.com/blog/blv-and-internet-explorer/feed/ 0
Centering Images in Better ListView Sub-items http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/ http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/#respond Wed, 06 Aug 2014 21:14:10 +0000 http://www.componentowl.com/blog/?p=906 Centered images in Better ListView

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.

]]>
http://www.componentowl.com/blog/centering-images-in-better-listview-sub-items/feed/ 0
Sub-item Check Boxes in Better ListView http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/ http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/#respond Sun, 06 Jul 2014 21:48:41 +0000 http://www.componentowl.com/blog/?p=901 Better ListView Sub-item Check Boxes

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.

]]>
http://www.componentowl.com/blog/sub-item-check-boxes-in-better-listview/feed/ 0
How to Add Grid Lines in Empty Space in Better ListView http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/ http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/#respond Wed, 30 Apr 2014 09:51:46 +0000 http://www.componentowl.com/blog/?p=894 Default list without grid lines below items

Default list without grid lines below items

List with grid lines added

List with grid lines added

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 – grid lines are hidden
  • Horizontal – only horizontal lines are displayed
  • Vertical – only vertical lines are displayed
  • Grid – both horizontal and vertical lines are displayed, forming a grid

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.

]]>
http://www.componentowl.com/blog/how-to-add-grid-lines-in-empty-space-in-better-listview/feed/ 0
Alternating Rows in Better ListView http://www.componentowl.com/blog/alternating-rows-in-better-listview/ http://www.componentowl.com/blog/alternating-rows-in-better-listview/#respond Tue, 22 Apr 2014 22:38:15 +0000 http://www.componentowl.com/blog/?p=888 Alternating Rows

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]

]]>
http://www.componentowl.com/blog/alternating-rows-in-better-listview/feed/ 0
Search Filtering in Better ListView http://www.componentowl.com/blog/search-filtering-in-better-listview/ http://www.componentowl.com/blog/search-filtering-in-better-listview/#comments Mon, 03 Feb 2014 14:58:30 +0000 http://www.componentowl.com/blog/?p=882 Search Filtering

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!

]]>
http://www.componentowl.com/blog/search-filtering-in-better-listview/feed/ 2
Custom Scroll Bar Size in Better ListView http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/ http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/#comments Tue, 19 Mar 2013 15:56:22 +0000 http://www.componentowl.com/blog/?p=878 Better ListView custom scroll bar size

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:

  • HScrollBarWidth
  • VScrollBarHeight

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.

 

 

 

 

]]>
http://www.componentowl.com/blog/custom-scroll-bar-size-in-better-listview/feed/ 4
How to Make Items Fading on Edges in Better ListView http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/ http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/#respond Tue, 05 Mar 2013 15:45:22 +0000 http://www.componentowl.com/blog/?p=868 Fading Edges in Better ListView

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
{
///

/// Default size of the fading gradient.
///

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
”’

”’ Default size of the fading gradient.
”’

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]

]]>
http://www.componentowl.com/blog/how-to-make-items-fading-on-edges-in-better-listview/feed/ 0