0.6.20 Displaying Structured Data in a DataGrid

A DataGrid Can Show Structured Records Inside an Application

You have already seen structured data in:

  • spreadsheets;
  • CSV files;
  • tables.

A C# desktop application can also display tabular information.

A DataGrid is a user-interface control designed to show data in rows and columns.

Conceptually:

Activity diagram showing structured records, then application data, then DataGrid, then visible rows and columns.
StructuredRecords.
  • New
  • Changed
  • Removed

This gives you another representation of the same structured information.

Begin With the Source Structure

Imagine a simple soccer CSV:

Activity diagram showing CSV file, then application, then DataGrid.
CSVFile.
  • New
  • Changed
  • Removed
Compare One Record Across Representations

Suppose one CSV row is:

Activity diagram showing supplied CSV, then supplied loading workflow, then application data, then DataGrid display.
SuppliedCSV.
  • New
  • Changed
  • Removed

Changing how a column looks does not automatically change the original CSV file.

Likewise, seeing a row on the screen does not mean the source file was rewritten.

Displayed Rows Should Preserve Record Identity

If one CSV row describes one course record, the DataGrid row should still represent that same record.

Values should not shift between records.

For example:

Course Code = ABC101
Course Name = Intro Course

must not accidentally become:

Course Code = Intro Course
Course Name = ABC101

A visible table can look orderly while still associating the wrong values with the wrong fields.

Compare representative records, not only the number of displayed rows.

Use the Supplied First Day Workflow as Evidence

In the First Day Module 0.6 activity, the important learner work is to:

  • inspect the supplied CSV;
  • recognize representative records and fields;
  • run the supplied data-loading path;
  • compare displayed rows and columns with the source;
  • confirm that values remain associated with the intended records and fields.

The learning goal is the data relationship, not independent parser design.

One Dataset, Several Representations

Module 0.6 now gives you several ways to view structured information.

CSV
plain-text row and field representation
Spreadsheet
editable grid of rows and columns
ERD
data-oriented structural model
UML class diagram
software-oriented structural model
DataGrid
application presentation of structured records

Understanding which representation you are looking at—and what role it serves—is more important than treating every table-shaped artifact as the same thing.