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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:16:55+00:00 2026-06-17T20:16:55+00:00

I Bind a ComboBox to an Entity. I want the Combobox to display on

  • 0

I Bind a ComboBox to an Entity.
I want the Combobox to display on each Item multiple values of different format (Integer, String and DateTime values), like this:

Item#1) 100  - Description - 01/01/2013

Item#2) 101  - Description - 01/01/2013

But the ComboBox only displays the SQL char (C# string) values, the others are empty:

Item#1)     - Description -

Item#2)     - Description - 

I have to use a Converter, am I on the wrong path, or there is a simpler solution?

In XAML

 <UserControl.Resources>
    <CollectionViewSource x:Key="tSCHEDEViewSource" d:DesignSource="{d:DesignInstance my:TSCHEDE, CreateList=True}" />
    <DataTemplate x:Key="SchedaTemplate">
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding Path=KSCHEDA}" Width="60"></TextBlock>
            <TextBlock Text="{Binding Path=DArticolo}" Width="200"></TextBlock>
            <TextBlock Text=" - " Width="40"></TextBlock>
            <TextBlock Text="{Binding Path=DStorico}" Width="150"></TextBlock>
        </StackPanel>
    </DataTemplate>
</UserControl.Resources>

<ComboBox ItemTemplate="{StaticResource SchedaTemplate}" Grid.Column="1" Grid.Row="1" Height="23"   HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="23,129,0,0" Name="tSCHEDEComboBox1" SelectedValuePath="KScheda" VerticalAlignment="Top" Width="393">
        <ComboBox.ItemsPanel>
            <ItemsPanelTemplate>
                <VirtualizingStackPanel />
            </ItemsPanelTemplate>
        </ComboBox.ItemsPanel>
    </ComboBox>

The .edmx Model

<EntityType Name="TSCHEDE">
      <Key>
        <PropertyRef Name="KSCHEDA" />
      </Key>
      <Property Name="KSCHEDA" Type="int" Nullable="false" />
      <Property Name="KLINEA" Type="int" Nullable="false" />
      <Property Name="DSCHEDA" Type="char" MaxLength="30" />
      <Property Name="DSTORICO" Type="datetime" />
      <Property Name="FINSMAN" Type="char" MaxLength="1" />
      <Property Name="DNOTE" Type="char" MaxLength="255" />
      <Property Name="FCANC" Type="char" MaxLength="1" />
      <Property Name="DArticolo" Type="char" MaxLength="60" />
      <Property Name="FFIGLIA" Type="char" MaxLength="1" />
    </EntityType>
  • 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-06-17T20:16:57+00:00Added an answer on June 17, 2026 at 8:16 pm

    I think that you have problem with case sensitive. When you binding you must exactly rewrite name of the variable.

    Try this:

    <UserControl.Resources>
        <CollectionViewSource x:Key="tSCHEDEViewSource" d:DesignSource="{d:DesignInstance my:TSCHEDE, CreateList=True}" />
        <DataTemplate x:Key="SchedaTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=KSCHEDA}" Width="60"></TextBlock>
                <TextBlock Text="{Binding Path=DARTICOLO" Width="200"></TextBlock>
                <TextBlock Text=" - " Width="40"></TextBlock>
                <TextBlock Text="{Binding Path=DSTORICO}" Width="150"></TextBlock>
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>
    

    In SelectedValuePath you also have wrong variable, change it to SelectedValuePath="KSCHEDA".

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

Sidebar

Related Questions

I have the following collection which i would like to bind to a combobox:
I want to bind combobox to value only and distinct name .But I get
I'm tryihg to bind a combobox item source to a static resource. I'm oversimplfying
I want to bind a combox with my entity model via domain services. My
I've seen how to bind a ComboBox to a list that has columns like
A very basic question : I want to bind a wpf ComboBox to a
I'd like to bind a ComboBox to a DataTable (I cannot alter its original
I am very new in MVC. I want to bind my combobox with server
I'm trying to bind multiple ComboBox's to a common source collection and enforce that
I am trying to bind a generic list like List Parents to a ComboBox.

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.