Below if the code I used to populate a ListView:
foreach (DataRow dr in dt_Updated.Rows) {
ListViewItem lvi = new ListViewItem(dr[eGisId].ToString());
listViewID.Items.Add(lvi);
}
listViewID.Items[0].Selected = listViewID.Items[0].Focused = true;
listViewID.View = System.Windows.Forms.View.List;
However, the data are populated on multiple columns if there are many. I want the data are populated only in one column, and meanwhile make the vertical scrollbar displayed.
Referring to
How to Set the property of vertical ScrollBar to Ultralistview control - Windows Forms - WinListView[
^] in which the user use
"myList".ViewSettingsList.MultiColumn = false;
Unfortunately, for the ListView control, I could not find its ViewSettingsList property.
What's the proper way to do it? I wish someone can provide his/her answer.
Besides, after the data displays, I want to the 1st item is highlighted with the default background color.
listViewID.Items[0].Selected = true;
But currently, the selected item displays like to be not highlighted. What I should do on this?
Thanks if you can help.
What I have tried:
Tried Populate ListView in one Column but not successful