$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
ListView WinForms Control
Create functional user interfaces, display data, group, filter, sort, and customize data items
Home > WinForms UI Controls > User Manual > Select and Size Items of ListView in C#

C# ListView Items Selection and Sizing

Kettic ListView WinForms Control provides the support of items selection and sizing. It is capable of selecting not only a single item but also multiple items in ListView control. The selection and sizing mechanism for ListView items make it easy to use the .NET component for Windows Forms project being deployed on other C#.NET applications. It is really easy to perform the selecting operations on the fly when the users exposed event for selecting items.

How to Set Items Selection for ListView

Kettic ListView .NET component allows the users to perform both a single item and multiple items selection operation in ListView. To set the selection operations for ListView control in C#.NET, we need to use the MultiSelect property of the ListView component. When we selected the ListView items, we can access the selected item through the SelectedItem property in the single selecting mode or in the multiple selecting mode from the SelectedItems collection of the Kettic ListView control in C# template projects.

How to Size ListView Items in C#

Kettic ListView provides the support of sizing items in ListView. The sizing operation is accomplished by using the DetailsView property to change the Height of the Item and using the Width property of the columns to change the width. The C# code below shows how to change the height of the items in ListView to 70pixels and set various widths for the columns in ListView for Windows Forms applications.

ketticListView1.ItemSize = new Size(0, 70);
ketticListView1.Columns[0].Width = 60;
ketticListView1.Columns[1].Width = 70;
ketticListView1.Columns[2].Width = 90;
Moreover, we can change the items size by using the ItemSize property. To use this ItemSize property, we need to disable the FullRowSelect property in ViewType.ListView. The C# code below demonstrates that how to achieve this.

ketticListView1.FullRowSelect = false;
ketticListView1.ItemSize = new Size(180, 35);
Additionally, the users can also change the item size for views by using the ItemSize property when disabling the properties, ApplyArbitraryItemWidth and ApplyArbitraryItemHeight. These two properties are used to adjust the size in different directions,
  • ApplyArbitraryItemWidth, this property will be able to change the item size in horizontal direction to fit the content when it is enabled.
  • ApplyArbitraryItemHeight, this property will be able to adjust the item size in vertical direction to fit the content when it is enabled.
The following is the C# code that shows how to set the ApplyArbitraryItemWidth and ApplyArbitraryItemHeight properties to false and adjust the item size.

ketticListView1.ItemSize = new Size(160, 80);
ketticListView1.ApplyArbitraryItemHeight = false;
ketticListView1.ApplyArbitraryItemWidth = false;
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls