Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Data class implementations not fully passed to Silverlight?

Data class implementations not fully passed to Silverlight?

Scheduled Pinned Locked Moved WPF
databasehelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael Eber
    wrote on last edited by
    #1

    Here is my scenario: Data Layer : running as an simple web service as required by Silverlight Entities are generated from the database tables An extended class is defined with the following additions:

    public partial class CustomerMaster
    {
    	public override string ToString( )
    	{
    		return this.CustomerName;
    	}
    }
    public partial class CustomerLocation
    {
    	public override string ToString( )
    	{
    		return this.\_LocationID;
    	}
    }
    

    CustomerMaster and CustomerLocation are two entities derived from the database. Silverlight side When I get my data I bind a list box to the result of my async query. I get the list of customers no problem. But listbox calls ToString() on my objects and I'm getting the default behaviour (namespace) not my overridden code!!!??? Anyone know a reason why this would happen?

    A 1 Reply Last reply
    0
    • M Michael Eber

      Here is my scenario: Data Layer : running as an simple web service as required by Silverlight Entities are generated from the database tables An extended class is defined with the following additions:

      public partial class CustomerMaster
      {
      	public override string ToString( )
      	{
      		return this.CustomerName;
      	}
      }
      public partial class CustomerLocation
      {
      	public override string ToString( )
      	{
      		return this.\_LocationID;
      	}
      }
      

      CustomerMaster and CustomerLocation are two entities derived from the database. Silverlight side When I get my data I bind a list box to the result of my async query. I get the list of customers no problem. But listbox calls ToString() on my objects and I'm getting the default behaviour (namespace) not my overridden code!!!??? Anyone know a reason why this would happen?

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Methods are not part of the DataContract so they won't be available when you create the proxy for the client.

      There's nothing left in my right brain and nothing right in my left brain.

      M 1 Reply Last reply
      0
      • A Abhinav S

        Methods are not part of the DataContract so they won't be available when you create the proxy for the client.

        There's nothing left in my right brain and nothing right in my left brain.

        M Offline
        M Offline
        Michael Eber
        wrote on last edited by
        #3

        yeh...found I had to specify the field in the data to display within the properties.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups