none
How to add second column to a listBox component? RRS feed

  • Question

  • For the moment I can only get the subfolders name of C:\Backup folder to the first column of the listBoxComputer.
    Have do I get also the last written date of subfolders to the second column of the listBoxComputer?
    private string rootDir = @"C:\Backup";        
    
    private void FormView_Load(object sender, EventArgs e)        {                       
       List<string> ls = Directory.GetDirectories(rootDir).Select(Path.GetFileName).ToList();            
        ls.Sort((a, b) => -1 * a.CompareTo(b));        
        listBoxComputer.Sorted = false;            
        listBoxComputer.DataSource = ls;            
        listBoxUser.SelectedIndex =-1;           
    }
    • Moved by CoolDadTx Monday, April 8, 2019 2:01 PM ASP.NET related
    Sunday, April 7, 2019 7:10 PM

All replies

  • Hello,

    You can look at the following code sample or better yet use a ListView.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, April 7, 2019 7:21 PM
  • Hi EKH10,

    Thank you for posting here.

    For your question, FormView is a web control. You use ASP.NET, you could get help from the ASP.NET forum.

    https://forums.asp.net/

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 8, 2019 5:56 AM