Windows Forms: ListView and DataGridView, Thesis of Engineering

An overview of the windows forms listview and datagridview controls, which are commonly used to display and manage collections of data in windows applications. The basics of creating and configuring these controls, including how to add and remove items, create columns, display icons and subitems, select items, group items, and enable tile view for the listview control. For the datagridview control, the document explains how to customize the appearance and behavior of the control, how to bind data to it, and how to access and manipulate the data displayed in the control. The document also includes a list of relevant questions that could be answered by studying this material, as well as information about related university topics, the most relevant university, and the specific university subject that this document is likely associated with. Overall, this document could be a useful resource for students studying windows forms development, data visualization, or user interface design.

Typology: Thesis

2022/2023

Uploaded on 07/25/2023

anh-thu-nguyen-18
anh-thu-nguyen-18 ๐Ÿ‡ป๐Ÿ‡ณ

1 document

1 / 41

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Programming
Lecture 13
Windows Form Part 4
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29

Partial preview of the text

Download Windows Forms: ListView and DataGridView and more Thesis Engineering in PDF only on Docsity!

Programming

Lecture 13

Windows Form Part 4

Agenda

โ€ข ListView

โ€ข DataGridView

โ€ข Data Binding

ListView

Have 2 options to create ListView
  1. ListView in Design
  2. ListView in Run-time

ListView

ListView in Design

Toolbox -> search ListView and drag ListView to Form Design

ListView

ListView in Design

Change Text value -> Add to add item to ListView

ListView

ListView in Design

Result

ListView โ— (^) Set Bound โ— (^) Set GridLines โ— (^) Set Columns โ— (^) Allow Column Reorder

Custom ListView

ListView โ— (^) ListView setData: using ListView.Items.AddRange (Array Object)

SetData ListView

ListView

ListView in Run-time

Set Data to ListView

ListView

ListView focused item

If want to set the item as focused when selecting an item in ListView

Question 1 How to: Add and Remove Items with the Windows Forms ListView Control โ— (^) Describes how to add or remove items from a list view. How to: Add Columns to the Windows Forms ListView Control โ— (^) Describes how to create columns in order to display information about each list item. How to: Display Icons for the Windows Forms ListView Control โ— (^) Describes how to associate a list view with an appropriate image list for displaying large or small icons. How to: Display Subitems in Columns with the Windows Forms ListView Control โ— (^) Describes how to display information about each list item in columns.

Question 2 How to: Select an Item in the Windows Forms ListView Control โ— (^) Describes how to programmatically select an item. How to: Group Items in a Windows Forms ListView Control โ— (^) Describes how to create groups for categorized display and how to assign items to each group. How to: Enable Tile View in a Windows Forms ListView Control โ— (^) Describes how to display items as tiles, each of which is comprised of a large icon and multiple lines of text.

DataGridView โ— (^) The DataGridView control provides a customizable table for displaying data. โ— (^) The DataGridView class allows customization of cells, rows, columns, and borders through the use of properties such as DefaultCellStyle, ColumnHeadersDefaultCellStyle, CellBorderStyle, and GridColor. โ— (^) Use a DataGridView control to display data with or without an underlying data source. DataGridView Definition

DataGridView โ— (^) Without specifying a data source, you can create columns and rows that contain data and add them directly to the DataGridView using the Rows and Columns properties. โ— (^) Use the Rows collection to access DataGridViewRow objects and the DataGridViewRow.Cells property to read or write cell values directly. โ— (^) The Item[] indexer also provides direct access to cells. DataGridView Definition