Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

how to add headers to listview inside tab control

$
0
0

Hi

I have a listview inside a tab control on windows form; i wanted to add headers to the listview;I tried to do this in constructor/ selectedindexchanged event of tab control but  headers are not added

  void InitListCtr()
        {
            listView1.Columns.Add("Name", 80, HorizontalAlignment.Left);
            listView1.Columns.Add("Type ", 80, HorizontalAlignment.Left);
            listView1.Columns.Add("Frequency", 65, HorizontalAlignment.Left);
            listView1.Columns.Add("Effective Date", 85, HorizontalAlignment.Left);
            listView1.Columns.Add("State ", 65, HorizontalAlignment.Left);
            listView1.Columns.Add("Next Run  ", 65, HorizontalAlignment.Left);

        }
the function is for sure called but the listview is not affected; I also tried to call the function from the parent window after instantiating the form that has the tab control

Viewing all articles
Browse latest Browse all 12583

Trending Articles



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