Need DataGridView to display rows chronologically

Hi

I've got various events happening at certain times and want to display them in a DataGridView.

Time Event Type

00:00:12 Event0 …

00:00:58 Event3 …

00:01:23 Event1 …

00:01:58 Event0 …

That's how it should look like in the DataGridView however the events are from a Xml file and not in the right order. Is it possible to use DataGridView to order rows (chronologically)

Thank you



Answer this question

Need DataGridView to display rows chronologically

  • Mick .

    First you have to read xml file. Use Dataset for that operation, if you have schema for xml file it will be great, but if not use InferSchema. Then set DataSource to the filled DataTable in Dataset.
    DataGridView has sort method, so use it to sort by your specific column after you set DataSource.

  • Need DataGridView to display rows chronologically