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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:36:04+00:00 2026-05-25T11:36:04+00:00

I have the below xaml that I am trying to bind to my class.

  • 0

I have the below xaml that I am trying to bind to my class. I am having trouble getting the values to show up. Can anyone point me in the direction of what I am missing. Thank you in advance.

 Dim frm As New EditPart
    frm.DataContext = New SelectedPart(_CPPartPicker.Selected_Part, "ABC")
    frm.Show()

 Class SelectedPart
Property Part_Key As Integer
Property Part_Id As String
Property Part_Rev As String
Property Whse As String
Property Part_Description As String
Sub New(Part As SNC.SL.Common.CP_Item.CP_Item_Lookup_Version_1Item_Lookup_Response, Whse As String)
    Part_Key = Part.ITEM_KEY
    Part_Id = Part.ITEM_ID
    Part_Rev = Part.ITEM_RVSN_ID
    Whse = Whse
    Part_Description = Part.ITEM_DESC
End Sub

End Class

  <Grid x:Name="LayoutRoot" Margin="2">
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <sdk:Label Content="{Binding Path=Part_Id, StringFormat='Part ID: \{0}'}" />
    <sdk:Label Content="{Binding Path=Part_Rev, StringFormat='Part Rev: \{0}'}" />
    <sdk:Label Content="{Binding Path=Part_Description, StringFormat='Description: \{0}'}"/>

        <Button x:Name="CancelButton" Content="Cancel" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
    <Button x:Name="OKButton" Content="OK" Width="75" Height="23" HorizontalAlignment="Right"  Margin="0,12,79,0" Grid.Row="1" />
</Grid>

In the ouput window I get the below error message:

Cannot get ‘Part_Id’ value (type ‘System.String’) from ‘SNC.CommonStock.SelectedPart’ (type ‘SNC.CommonStock.SelectedPart’). BindingExpression: Path=’Part_Id’ DataItem=’SNC.CommonStock.SelectedPart’ (HashCode=53866394); target element is ‘System.Windows.Controls.Label’ (Name=”); target property is ‘Content’ (type ‘System.Object’).. System.MethodAccessException: Attempt by method ‘System.Windows.CLRPropertyListener.get_Value()’ to access method ‘SNC.CommonStock.SelectedPart.get_Part_Id()’ failed.

  • 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-25T11:36:05+00:00Added an answer on May 25, 2026 at 11:36 am

    The labels are all on top of one another at present, if there is no description then potentially you’ll see no content. Place the labels in a StackPanel.

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

Sidebar

Related Questions

I have below XAML code : <Window x:Class=WpfApplication1.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml DataContext={Binding RelativeSource={RelativeSource Self}} WindowStartupLocation=CenterScreen
I have below query I am trying to show message 'No SubSource for this
I have a UserControl (XAML below) that has a ListBox that I want to
I am trying to use the xaml below to define a Button that will:
I have trying a simple repeat animation on xaml page as below: <StackPanel Canvas.Left=1
I have below structure <div class=mybox> <div id=imageslide> <a href=><img src=url /></a> </div> </div>
I have below code: class Program { static void Main(string[] args) { Task[] tasks
I have a WPF application that mostly follows MVVM, which I am trying to
I have a WPF CustomControl that is derived from ComboBox and I'm trying to
I'm trying to build a UI layout in WPF that can scale with the

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.