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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:42:39+00:00 2026-05-27T16:42:39+00:00

I have a WPF application that uses a TabControl. Each TabItem will contain a

  • 0

I have a WPF application that uses a TabControl. Each TabItem will contain a datagrid. When the application starts up, there is one TabItem that loads by default that displays an “Accounts” datagrid. This datagrid displays only account information. The user can then choose to add new Tabs. For each tab that is added, I need the same datagrid to be loaded. It is NOT the same datagrid that is used for the Accounts TabItem. The new datagrid will be used to enter transactions. How can I define a datagrid that I can use in each newly added TabItem, but is different than the original datagrid on the first TabItem?

  • 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-27T16:42:40+00:00Added an answer on May 27, 2026 at 4:42 pm

    So if I understand correctly what you want is a default DataGrid for the first tabitem and then for each new tabitem same datagrid.

    Problem here is that a single DataGrid cannot be part of Two TabItems at the same time. So what you would have to do it first declare a DataGrid in a scope where it can be accessed in the code behind. Next, when user adds a new tabitem, first time, add a tab item dynamically in the tab control and set content equal to DataGrid. When user clicks the add new tab item again, remove the content of tab item which previously had DataGrid and then Add datagrid in the new tab item. You will also have to handle the selection change event of tabs and inside that event you will have to remove DataGrid from last selected item and put in the newly selected item.

    I am not sure you really need this same dataGrid for different tab items thing or not but think before implementing this approach about other possible solutions

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

Sidebar

Related Questions

I'm writing a WPF application that uses one document at a time. Is there
I have a TabControl in my WPF application that uses the default colors for
I have a simple WPF application that uses ClickOnce to handle installing. Within this
I have an application that uses WPF Composite, and I have an issue. I've
I have a fairly large application that uses WPF for its user interface. I
I have a WPF application that will always run on windows 7, it opens
I have an WPF Full Tust explorer application that uses a COM assembly. In
I have a WPF application implemented using the MVVM framework that uses an ActiveX
I have a WPF application that uses a WCF services to perform operations on
I have a WPF application that uses a custom window frame. My problem is

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.