0% found this document useful (0 votes)
25 views10 pages

Datagridview: Pemrograman Visual (Th22012) by Kartika Firdausy Pvisual@Ee - Uad.Ac - Id Blog - Uad.Ac - Id/Kartikaf

This document discusses DataGridView, a rectangular control in Visual Programming (TH22012) that displays data in a table format using rows and columns. It describes how the top section displays column headers, the left side displays row headers, and cells are created at the intersections of columns and rows. It also mentions that default characteristics like colors, widths and heights can be customized. Steps provided include adding columns through the toolbox, specifying column names and types, and populating the grid view with data by clearing rows and looping to add values to cells.

Uploaded by

Gost
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views10 pages

Datagridview: Pemrograman Visual (Th22012) by Kartika Firdausy Pvisual@Ee - Uad.Ac - Id Blog - Uad.Ac - Id/Kartikaf

This document discusses DataGridView, a rectangular control in Visual Programming (TH22012) that displays data in a table format using rows and columns. It describes how the top section displays column headers, the left side displays row headers, and cells are created at the intersections of columns and rows. It also mentions that default characteristics like colors, widths and heights can be customized. Steps provided include adding columns through the toolbox, specifying column names and types, and populating the grid view with data by clearing rows and looping to add values to cells.

Uploaded by

Gost
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

• Pemrograman Visual (TH22012 )

by Kartika Firdausy
[email protected]
blog.uad.ac.id/kartikaf
kartikaf.wordpress.com

DataGridView
DataGridView

A data grid view is a rectangular control


made of columns and rows:
DataGridView
The top section of the control displays column headers as gray boxes
with each showing a caption.
On the left side, there are gray boxes referred to as row headers.
The cells are the intersections of the columns and the rows.
Those cells are white.
These are the default characteristics of columns, rows, and cells.
In reality, most aspects can be customized. They can show different
colors, different widths, and different heights.
Toolbox  DataGridView
Menambah kolom  Add Column
Add Column
Tipe kolom
Nama kolom

Header kolom
Hasil
Memberi judul kolom

dataGridViewTabel->Columns->Add("USD", "USD");
dataGridViewTabel->Columns->Add("Rupiah", "Rupiah");
Event handler buttonHitung (Click)

int Kurs, Rupiah, USD;

Kurs = Convert::ToInt16(textBoxKurs->Text);
dataGridViewTabel->Rows->Clear();
int n = dataGridViewTabel->Rows->Add(9);
for (int i=1; i<=10; i++)
{
USD = i;
Rupiah = i*Kurs;
dataGridViewTabel->Rows[i-1]->Cells["USD"]->
Value = Convert::ToString(USD);
dataGridViewTabel->Rows[i-1]->Cells["Rupiah"]->
Value = Convert::ToString(Rupiah);
}

You might also like