Files
componentowl-astro/public/documentation/better-listview-express/data/chapter-columns.html

204 lines
8.8 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Columns</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="prettify.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="prettify.js"></script><script type="text/javascript" src="lang-vb.js"></script><link href="../resources/main.css" media="screen" rel="stylesheet" type="text/css">
</head>
<body onload="prettyPrint()"><div class="placing">
<br><table class="navigation"><tr>
<td class="navigation-previous"><a href="chapter-collections.html"><strong>
« Collections</strong></a></td>
<td class="navigation-index"><a href="../../../better-listview-express/documentation.html"><strong>Index</strong></a></td>
<td class="navigation-next"><a href="chapter-context-menus.html"><strong>Context Menus »
</strong></a></td>
</tr></table>
<br><h1>Columns</h1>
<div class="banner">
<a href="../../../blog/page/6/index.html"><img src="../resources/overview.gif" alt="Better ListView" class="ss"></a>
<div class="inside">
<div class="text">Better ListView: Ultimate .NET ListView replacement control for WinForms (C#, VB.NET)</div>
<span class="dbtn-c dbtn-hilight"><span class="dbtn-w"><a href="../../../betterlistview.exe" class="dbtn">Download</a></span></span>
<span class="dbtn-c"><span class="dbtn-w"><a href="../../../blog/page/6/index.html" class="dbtn">More Info</a></span></span>
</div>
</div>
<h2>Displaying/Hiding all Column Headers</h2>
<p>To display column headers in other views than
<strong><em>Details</em></strong>, set <span class="code">ColumnsDisplayMode</span> property
to <span class="code">ShowAlways</span>. The default value is <span class="code">ShowDetails</span>
(show column headers in <strong><em>Details</em></strong> view only). Setting
the property to <span class="code">Hide</span> hides all column headers.</p>
<p>Following image shows column headers displayed in Tile view:</p>
<p class="images"><img src="column-all-views.png"></p>
<p>To hide specific columns only, see <strong><em><a href="chapter-columns.html#hide-custom">Hiding Custom Columns</a></em></strong> below.</p>
<h2>Column Header Styles</h2>
<p>Each column header can have one of three styles defined by
<span class="code">BetterListViewColumnHeader.Style</span> property:</p>
<ul style="list-style:none">
<li>
<span class="code">BetterListViewColumnHeaderStyle.Clickable</span><ul style="list-style:none"><li>
<p>Default value. The column gets highlighted when mouse cursor
hovers over it and registers mouse clicks.</p>
</li></ul>
</li>
<li>
<span class="code">BetterListViewColumnHeaderStyle.Nonclickable</span><ul style="list-style:none"><li>
<p>The column does not react to mouse.</p>
</li></ul>
</li>
<li>
<span class="code">BetterListViewColumnHeaderStyle.Sortable</span><ul style="list-style:none"><li>
<p>The column is clickable and items get sorted according to this
column. Small arrow appears on the column header when items are
sorted.</p>
</li></ul>
</li>
</ul>
<h2>
<a name="hide-custom" id="hide-custom"></a>Hiding Custom Columns</h2>
<br><hr>
<p class="note">Custom column hiding feature is not available in <strong><em>Better
ListView Express</em></strong>.</p>
<hr>
<br><p>One way to hide a column would be simply removing it from
<span class="code">Columns</span> collection. When there are items with sub-items,
however, this approach requires removing also all the sub-items for the
corresponding removed column.</p>
<p>When you need to just visually hide a column and corresponding
sub-items (without removing them), call
<span class="code">BetterListViewColumnHeader.Hide()</span> method. To re-show hidden
column, call <span class="code">BetterListViewColumnHeader.Show()</span>. The same can
be obtained by setting <span class="code">BetterListViewColumnHeader.Visible</span>
property.</p>
<p>The following images show hiding some column in application which
uses cotext menu for this action:</p>
<p class="images"><img src="column-hide-before.png"></p>
<p class="images"><img src="column-hide-after.png"></p>
<h2>Column Resizing</h2>
<p>Columns are resizable by default. There are two properties for
setting-up this feature on each column:</p>
<ul>
<li>
<p><span class="code">BetterListViewColumnHeader.MinimumWidth</span></p>
</li>
<li>
<p><span class="code">BetterListViewColumnHeader.MaximumWidth</span></p>
</li>
</ul>
<p>Values of these properties depend upon each other and the
<span class="code">BetterListViewColumnHeader.Width</span> property. This is because
the minimum width have to be always smaller than the maximum width and the
column width have to lay between the two extremes.</p>
<p>To disable column resizing for a given column, set
<span class="code">BetterListViewColumnHeader.AllowResize</span> to
<span class="code">false</span>.</p>
<p>To detect column width adjustment, use the
<span class="code">ColumnWidthChanging</span> and <span class="code">ColumnWidthChanged</span>
events.</p>
<br><hr>
<p class="note">Column header can have zero minimum width. In that case, it is
possible to completely hide the column header. If several neighboring
columns are collapsed this way, expanding them back is possible by
dragging right side of a collapsed column header border.</p>
<hr>
<br><h2>Column Reordering</h2>
<br><hr>
<p class="note">This feature is not available in <strong><em>Better ListView
Express</em></strong>.</p>
<hr>
<br><p class="images"><img src="column-reorder.png"></p>
<p>Column reordering is disabled by default, but se be set-up by simply
settings <span class="code">ColumnReorderMode</span> property to one of the following
values:</p>
<ul style="list-style:none">
<li>
<span class="code">Disabled</span><ul style="list-style:none"><li>
<p>Column reordering is disabled (default value).</p>
</li></ul>
</li>
<li>
<span class="code">Custom</span><ul style="list-style:none"><li>
<p>Column reordering is enabled, but the actual reordering is
governed from user code; only ColumnReordered event is
raised.</p>
</li></ul>
</li>
<li>
<span class="code">ColumnsOnly</span><ul style="list-style:none"><li>
<p>Column reordering is done on columns-only, not
sub-items.</p>
</li></ul>
</li>
<li>
<span class="code">Enabled</span><ul style="list-style:none"><li>
<p>Column reordering is enabled.</p>
</li></ul>
</li>
</ul>
<p><span class="code">ColumnReordered</span> event is raised after column reordering
is finished. The actual reordering consists of switching column items in
the <span class="code">Columns</span> collections and the corresponding sub-items in
each row. This feature actually modifies data in the list, not only the
visual part. If you need to do any other processing (e.g. switch item
texts only), use custom reordering mode.</p>
<br><div class="banner">
<a href="../../../blog/page/6/index.html"><img src="../resources/overview.gif" alt="Better ListView" class="ss"></a>
<div class="inside">
<div class="text">Better ListView: Ultimate .NET ListView replacement control for WinForms (C#, VB.NET)</div>
<span class="dbtn-c dbtn-hilight"><span class="dbtn-w"><a href="../../../betterlistview.exe" class="dbtn">Download</a></span></span>
<span class="dbtn-c"><span class="dbtn-w"><a href="../../../blog/page/6/index.html" class="dbtn">More Info</a></span></span>
</div>
</div>
<table class="navigation"><tr>
<td class="navigation-previous"><a href="chapter-collections.html"><strong>
« Collections</strong></a></td>
<td class="navigation-index"><a href="../../../better-listview-express/documentation.html"><strong>Index</strong></a></td>
<td class="navigation-next"><a href="chapter-context-menus.html"><strong>Context Menus »
</strong></a></td>
</tr></table>
<br><table class="footer"><tr>
<td class="footer-title">Better ListView Express Documentation
</td>
<td class="footer-copyright">
Copyright © <a href="../../../index.html" target="_blank">ComponentOwl.com</a>
</td>
</tr></table>
</div></body>
</html>