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

  • Home
  • SEARCH
  • 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 4622438
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:50:36+00:00 2026-05-22T02:50:36+00:00

When I create a new TabItem I create a new CheckBox at the same

  • 0

When I create a new TabItem I create a new CheckBox at the same time.
I would like to bind the TabItem’s visibility to the CheckBox, but am having trouble setting up the binding.

                CheckBox cb = new CheckBox();
                cb.Content = tabItemName;
                cb.Name = tabItemName;

                var visibilityBinding = new Binding("IsChecked");
                visibilityBinding.Mode = BindingMode.TwoWay;
                visibilityBinding.ElementName = cb.Name;  // this could just be a string literal 
                visibilityBinding.Converter = new VisibilityConverter();
                m.TabItem.SetBinding(TabItem.VisibilityProperty, visibilityBinding);

                cb.IsChecked = true;

At runtime I get this error:
System.Windows.Data Error: BindingExpression path error: ‘IsChecked’ property not found on ‘Telerik.Windows.Controls.RadTabItem’ ‘Telerik.Windows.Controls.RadTabItem’ (HashCode=66442352). BindingExpression: Path=’IsChecked’ DataItem=’Telerik.Windows.Controls.RadTabItem’ (HashCode=66442352); target element is ‘Telerik.Windows.Controls.RadTabItem’ (Name=’Central …’); target property is ‘Visibility’ (type ‘System.Windows.Visibility’)..

What am I doing wrong? I thought the argument to the Binding ctor was the property on the source object (the CheckBox) that being bound to the property named in the SetBinding() call..

Thanks for any advice…

UPDATE:
I added
visibilityBinding.Source = cb;

and get this error at runtime:
Binding.RelativeSource cannot be set while using Binding.Source

  • 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-22T02:50:37+00:00Added an answer on May 22, 2026 at 2:50 am

    Binding.Source() is necessary for binding programmatically, and is exclusive with Binding.ElementName.
    So, this works:

    var visibilityBinding = new Binding("IsChecked");
    visibilityBinding.Source = cb;
    visibilityBinding.Mode = BindingMode.TwoWay;
    // visibilityBinding.ElementName = cb.Name; 
    visibilityBinding.Converter = new VisibilityConverter();
    m.TabItem.SetBinding(RadTabItem.VisibilityProperty, visibilityBinding);
    

    Hope this helps someone else….

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

Sidebar

Related Questions

I can create new Silverlight App with .NET RIA Services enabled. But when I
I'm having trouble binding values to dynamically created controls. When a user loads a
I'd like to create new item that similarly to Util.Map.Entry that will contain the
I'd like to create new command line to attach Visual Studio to an application
We are able to create new entities without any issues, but updating an existing
Is it possible to create new signals in Python GTK+ ? I'd like a
I'm trying to create new application using BLToolkit but i can't compile the code,
I know we can create new properties in Javascript objects during runtime but could
I create new ASP.NET web application that use SMTP to send message. The problem
I create new desktop with CreateDesktop and want to get it's DC & RC.

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.