// Queries tag values for the selected tag key and displays them async Task BindTagValues() { // Clear the current items listView.Items.Clear(); // Get the values for the current tag key var selectedTag = tagKeysComboBox.SelectedItem as string; if (selectedTag != null) { var tagValues = await InfluxDbClient.GetTagValuesAsync(Database, Measurement, selectedTag); // Add default row count column listView.Columns.Add(new ColumnHeader() { Text = "#" }); // Add tag value column listView.Columns.Add(new ColumnHeader() { Text = "tagValue" }); // Add each value to the list var rowCount = 0; foreach (var tv in tagValues) { listView.Items.Add(new ListViewItem(new string[] { (++rowCount).ToString(), tv.Value }) { Tag = tv }); } } }