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 282005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:15:07+00:00 2026-05-12T05:15:07+00:00

How to create a tab control with a dynamic number of tabs in Visual

  • 0

How to create a tab control with a dynamic number of tabs in Visual Studio C#?

I’ve got a database with a table customers. I need to create a form that would show tabs with the first letters of customers’ last name (only those first letters, for which there are entries in the table should be present). Each tab should contain a DataGrid control with the corresponding customers. I connect to the database using DataSet.

Where should I insert the code snippet that would generate such tabs? Can I do that with the existing tab control or should I create a custom control?

  • 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-12T05:15:07+00:00Added an answer on May 12, 2026 at 5:15 am

    You can generate dynamic tabs with the existing TabControl. Here is an example of how it can be done in a somewhat sort of pseudo code form…

    TabControl tabControl = new TabControl();
    tabControl.Dock = DockStyle.Fill;
    
    foreach (Char c in lastNameList)
    {
        TabPage tabPage = new TabPage();
        tabPage.Text = c.ToString();
    
        DataGrid grid = new DataGrid();
    
        grid.Dock = DockStyle.Fill;
        grid.DataSource = dataForTheCurrentLoop;
    
        tabPage.Controls.Add(grid);
        tabControl.Controls.Add(tabPage);
    }
    
    this.Controls.Add(tabControl);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to create a Tab Control Style that basically looks like buttons
I want to create a UI that uses a tab control to display multiple
I want to create a Tab Control that only opens content once. Each item
I need to create a control which has a single permanent tab (home), and
I am currently building a dynamic url tab system that user can say what
I don't like the way the tabs look with the native tab control in
As documented: If not all tabs can be shown at once, the tab control
I have an ASP.net page. That has an Ajax Toolkit Tab Control. That has
If I create a jQuery UI tab control. I add one tab. I add
How do I create tabbed navigation with the Current tab highlighted in the UI?

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.