ListView Built-in Checkboxes and Editors
Kettic ListView WinForms Control contains built-in checkboxes for data items and allows the users to editing the items in ListView in C#.NET. The Checkboxes of ListView items can be displayed by enable the DisplayCheckBoxes property and the ListView items editing feature can be enabled by changing the value of the ApplyEditing property to True. The checkboxes allows the users to check or uncheck each ListView item displayed and get or set the check state. The items editing feature allows the users to edit the label of the ListView items.
How to Manipulate Checkboxes in ListView in C#.NET
It is easy to manipulate the item checkboxes for ListView control. To enable this functionality to the ListView in your Windows Forms projects, we need to set the DisplayCheckBoxes property to True in ListView. After enabling the checkboxes, we can simply check or uncheck items through the checkbox displayed in each item, get or set the checked state of the ListViewDataItem through the CheckedState property, get the checked items in Kettic ListView from the CheckedItems collection. The ChangingCheckedItem and ChangedCheckedItem events will shows the changes in the check state of the items
How to Manipulate Editors in ListView in C#.NET
Kettic ListView allows the users to edit the ListView items. The default setting invokes the text editor and allows the users to edit the items label. To enable this functionality, we can set the ApplyEditing property to True and select an item to initiate the editing. After finishing the editing, the values will be assigned to the Value property of the items. The user can cancel the editing by using the Esc key. Kettic ListView also allows the users to initiate and cancel the editing process in C# code for their application. There are three methods available to accomplish this, the StartEdit() method, the EndEdit() method, and the CancelEdit() method. The StartEdit() method will initiate editing on the selected item, the EndEdit() method will end editing and save the edited value, and the CancelEdit() method will end the editing and discard the edited value. The C# code below shows how to editing using the C# API.
How to Edit Lifecycle in C#.NET
After we display an item in Kettic ListView control and initiate the editing mode, the StartEdit() method will be called, the ItemEditing event will be fired and a text box editor will appear in the selected item in the ListView. We can follow the steps below to edit the items for ListView.
The C# code below shows how to edit integer values by using the ValidateItem event.
How to Switch Editors in C#.NET
The EditorRequired event will be fired before the editing is performed. This event is able to replace the default text box editor with one of built-in editors, ListViewTextBoxEditor, ListViewDropDownListEditor, ListViewSpinEditor, and ListViewDateTimeEditor. Furthermore, the users can create custom instance as an editor. The C# code below demonstrates how to use the built-in editors.
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