Doogledude123 45 Posting Whiz

I have this method that is used to set the columns and data in the listview based on a string. I'm not sure how to add the columns I need programactically. I need to use different data types though.

private void populateLeaderBoardList()
        {
            string btnContent = (string)btn_exportLeaderBoard.Content;

            if (btnContent.Contains("Totals"))
            {
                // Using data type Player
                // Set Columns (leaderBoardPosition (#++ each row), playerTeamName, playerPoints)
            }
            else if (btnContent.Contains("Players"))
            {
                // Using data type Player
                // Set Columns (leaderBoardPosition (#++ each row), playerTeamName, playerPoints)
            }
            else if (btnContent.Contains("Drivers"))
            {
                // Using data type DriverPoints
                // Set Columns (leaderBoardPosition (#++ each row), driverCarNumber, driverName, driverPoints)
            }
        }

How would I go about defining this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.