Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Listview code help

$
0
0

I have tried rearranging this code a couple times, and either it completely doesn't work, or it displays weird on the list view.

So what I wan't to know is instead of this code displaying on the list view as "String, Names" how can I make it display as "Names, String" ? 

        private void NameOrdering()
        {
            String Names;
            Int32 Index = 0;
            listView1.Items.Clear();
            listView1.BeginUpdate();
            for (UInt32 i = 0; i < 18; i++)
            {
                Names = GetName(i);
                if (Names != "")
                {
                    ListViewItem Items;
                    Items = new ListViewItem();
                    Items.Text = Index.ToString();
                    Items.SubItems.Add(Names);
                    listView1.Items.Add(Items);
                    Index++;
                }
            }
            listView1.EndUpdate();
        }


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>