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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:46:05+00:00 2026-05-14T18:46:05+00:00

Requirement is to create a reusable multi-select combobox custom control. To accomplish this, I

  • 0

Requirement is to create a reusable multi-select combobox custom control. To accomplish this, I am creating the DataTemplate dynamically through code and set the combobox ItemTemplate. I am able to load the datatemplate dynamically and set the ItemTemplate, but getting unhandled exception (code: 7054) when combobox is selected.

Here is the code

 Class MultiSelCombBox: ComboBox
 {
    public override void OnApplyTemplate()
    {
        base.OnApplyTemplate();
        CreateTemplate();
    }

    void CreateTemplate()
    {
        DataTemplate dt = null;
        if (CreateItemTemplate)
        {
            if (string.IsNullOrEmpty(CheckBoxBind))
            {
                dt = XamlReader.Load(@"<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' x:Name=""DropDownTemplate""><Grid xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' x:Name=""CheckboxGrid""><TextBox xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' x:Name=""test"" xml:space=""preserve"" Text='{Binding " + TextContent + "}'/></Grid></DataTemplate>") as DataTemplate;
                this.ItemTemplate = dt;
            }
        }
    }
  //Other code goes here }}

what am i doing wrong? suggestion?

  • 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-14T18:46:06+00:00Added an answer on May 14, 2026 at 6:46 pm

    err.. mistake in the code. shouldn’t redefine namespaces on each element. Top element only.

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

Sidebar

Related Questions

I have a requirement to create a windows form control which has to detect
I have a requirement to create a multi level treeview in ASP.Net (with VB)
I have a requirement to create a sysDesk log file. In this requirement I
I have a requirement to create Chart like this : http://sourceforge.net/projects/ecgtoolkit-cs/ I have to
Normally I create web application projects and use code-behind, but I have a requirement
I have a requirement to create custom exception for the exceptions generated by my
We are upgrading a 15 year old code-base, there is a requirement to create
Windows Form (in C#) - I need to create a custom listbox control for
I have requirement to create an asp.net wizard control which will be re usable
I have a requirement to create XML that looks like this: <record id=100000000000000000 type=Message>

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.