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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:50:00+00:00 2026-05-24T16:50:00+00:00

I’m using the EntityFramework and working on an invoicing application. Below is the xaml

  • 0

I’m using the EntityFramework and working on an invoicing application. Below is the xaml code from myDataGrid. Now it compiles and everything works great, but the problem is, the static binding I have on the DataGridComboBoxColumn throws an exception when in designer mode because that static property actually loads from a MySql database using the entity framework.

    <DataGrid x:Name="ItemsGrid" Grid.Row="2" Grid.ColumnSpan="3" ItemsSource="{Binding Items}" FontSize="11" AutoGenerateColumns="False" CanUserAddRows="False" RowHeaderWidth="0" GridLinesVisibility="None" CanUserResizeRows="False" CanUserResizeColumns="False" CanUserReorderColumns="False">
        <DataGrid.Columns>
            <DataGridTemplateColumn Width="150" Header="Item No.">
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBox Width="130" BorderThickness="0" Background="Transparent" Text="{Binding Number}" />
                            <Image MouseDown="ItemSelectionButton_Click" Margin="0,0,0,0" Width="12" Source="/Images/Icons/SearchBlack.png" />
                        </StackPanel>
                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>
            <DataGridTextColumn Width="70" Header="Quantity" Binding="{Binding Quantity}" />
            <DataGridTextColumn Width="70" Header="Order" Binding="{Binding Order}" />
            <DataGridTextColumn Width="70" Header="B/O" Binding="{Binding BackOrder}" />
            <DataGridTextColumn Width="60" Header="Units" Binding="{Binding Units}" />
            <DataGridTextColumn Width="200" Header="Description" Binding="{Binding Description}" />
            <DataGridTextColumn Width="90" Header="Price" Binding="{Binding Price}" />
            <DataGridComboBoxColumn Width="50" Header="Tax" ItemsSource="{x:Static app:Session.TaxCodes}" SelectedValueBinding="{Binding TaxCodeID}" DisplayMemberPath="Code" SelectedValuePath="ID" />
            <DataGridTextColumn Width="90" Header="Amount" Binding="{Binding Amount}" />
            <DataGridTextColumn Width="90" Header="Linked" Binding="{Binding SalesOrderID}" />
        </DataGrid.Columns>
    </DataGrid>

Here’s the exception:

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
   at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
   at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
   at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
   at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
   at DtcInvoicer.Models.DatabaseEntities..ctor() in F:\Development\DTC Industrial\DtcInvoicer\DtcInvoicer\Models\DatabaseModel.Designer.cs:line 42
   at DtcInvoicer.Models.Repository.get_GetContext() in F:\Development\DTC Industrial\DtcInvoicer\DtcInvoicer\Models\Repository.cs:line 14
   at DtcInvoicer.Models.TaxCodesRepository.SelectAll() in F:\Development\DTC Industrial\DtcInvoicer\DtcInvoicer\Models\TaxCodesRepository.cs:line 54
   at DtcInvoicer.Session..cctor() in F:\Development\DTC Industrial\DtcInvoicer\DtcInvoicer\Session.cs:line 18

I know trying to fix the root of the problem will be too much work, I’m wondering if there’s a simple workaround like dynamically binding to a static property in another class. Anyone have any idea how to do this? Looking for a xaml only solution.

Here’s what I already tried…

ItemsSource="{Binding Path=TaxCodes, Source={x:Static app:Session}}"

ItemsSource="{Binding Path=TaxCodes, Source={StaticResource app:Session}}"

ItemsSource="{Binding app:Session.TaxCodes}"

Any help is appreciated.

Thanks.

  • 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-24T16:50:01+00:00Added an answer on May 24, 2026 at 4:50 pm

    Could you use something like d:ItemsSource="{x:Null}", and define d in your Window or UserControl like mc:Ignorable="d"?

    It should make the design-time property of ItemsSource equal to null

    Edit

    Forgot to add the definition for mc – It is
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

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

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build

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.