mardi 7 avril 2015

Add auto number column to list view table?

I've a ListView that fetch data from SQL compact CE database. I've an ID column in the database already , but I want to add an auto number column in the list view itself.


I want to replace the ID column with an auto number column (I don't want the number to be saved in the database itself , I just want to sort the rows in the list view) http://ift.tt/1Pf0ETT


The code I'm using :



ListViewItem item = new ListViewItem(sqldr["ID"].ToString());
item.SubItems.Add(sqldr["EnglishWord"].ToString());
item.SubItems.Add(sqldr["EnglishDesc"].ToString());
item.SubItems.Add(sqldr["ArabicDesc"].ToString());
item.SubItems.Add(sqldr["ArabicWord"].ToString());
item.SubItems.Add(sqldr["Subject"].ToString());


listView1.Items.Add(item);


I'm using C# - Windows Application - WinForms


Aucun commentaire:

Enregistrer un commentaire