Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6365159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:15:28+00:00 2026-05-25T00:15:28+00:00

I have a members name coming from a database. Now I need to display

  • 0

I have a members name coming from a database. Now I need to display these items in a list box. I have another table products coming from database.

As per client requirement, I need to display these items in the same list box.

list box diagram

Is it possible to place two lists of items in the same list box separated by empty space? And is it possible to trigger some action when clicking on an item?

Could anyone please help on this?

If it’s not possible with list box, is it possible in a list view to add two groups in a single column separated with white space as shown in the figure above?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:15:29+00:00Added an answer on May 25, 2026 at 12:15 am

    Here is a very basic example of a ListView with groups:

    This MSDN article has a more advanced example: ListViewGroup Class

    Be aware that groups are only supported on certain operating systems (XP and above I think), so you will need to factor this in to your code.

    listView1.View = View.Details;
    listView1.Columns.Add(new ColumnHeader() { Width=-1 });
    listView1.HeaderStyle = ColumnHeaderStyle.None;
    
    ListViewGroup membersGroup = new ListViewGroup("Members", HorizontalAlignment.Left);
    listView1.Groups.Add(membersGroup);
    listView1.Items.Add(new ListViewItem() { Text = "Member 1", Group = membersGroup });
    listView1.Items.Add(new ListViewItem() { Text = "Member 2", Group = membersGroup });
    
    ListViewGroup productsGroup = new ListViewGroup("Products", HorizontalAlignment.Left);
    listView1.Groups.Add(productsGroup);
    listView1.Items.Add(new ListViewItem() { Text = "Product 1", Group = productsGroup });
    listView1.Items.Add(new ListViewItem() { Text = "Product 2", Group = productsGroup });
    

    And here is an example using a TreeView:

    var members = new[] 
                {
                    new { MemberName = "Member 1", MemberId = 1 },
                    new { MemberName = "Member 2", MemberId = 2 }
                };
    var products = new[] 
                {
                    new { ProductName = "Product 1", ProductId = 1 },
                    new { ProductName = "Product 2", ProductId = 2 }
                };
    
    TreeNode membersNode = new TreeNode("Members", members.Select(m => new TreeNode(m.MemberName)).ToArray());
    TreeNode productsNode = new TreeNode("Products", products.Select(p => new TreeNode(p.ProductName)).ToArray());
    
    treeView1.Nodes.Add(membersNode);
    treeView1.Nodes.Add(productsNode);
    

    Hope these help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MEMBERS table with the following relevant columns: Name JoinDate Level --1=Gold,2=Silver,3=Bronze**
I have Members table, for example with the following entries: Name | Group |
I have a members table in MySQL CREATE TABLE `members` ( `id` int(10) unsigned
I have a class named Data with some public members: Name , Age ,
I need some help in coding this in C# I have a list of
I need some guidance. I am parsing an XML and get the members name
In my application i have a collection_select on my members table, the members table
I have a few checkboxes coming from nested model ( :admin accepts_nested_attributes_for :account_setting ).
I have a table memberaccounts member_id member_name membertransactionamount memberaccount_id and my entity name is
I have the following SQL query: SELECT members.member_ID, members.nick_name FROM orgs INNER JOIN assets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.