Click here to Skip to main content
15,893,668 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: The remote server returned an error: NotFound. Pin
Michael Eber28-Dec-09 12:27
Michael Eber28-Dec-09 12:27 
QuestionHelp With My WPF (C#) Application - Challenging Part Pin
johg13-Dec-09 13:08
johg13-Dec-09 13:08 
QuestionTabControl in WPF Pin
Anu_Bala11-Dec-09 18:17
Anu_Bala11-Dec-09 18:17 
QuestionMultithreading in WinForm/WPF Application Pin
sandeepranjan11-Dec-09 15:09
sandeepranjan11-Dec-09 15:09 
AnswerRe: Multithreading in WinForm/WPF Application Pin
Richard MacCutchan12-Dec-09 2:12
mveRichard MacCutchan12-Dec-09 2:12 
QuestionSame object in 2 views? Pin
AghaKhan11-Dec-09 1:50
AghaKhan11-Dec-09 1:50 
QuestionDatabinding to simple controls with RIA services Pin
RB@Emphasys10-Dec-09 12:24
RB@Emphasys10-Dec-09 12:24 
AnswerRe: Databinding to simple controls with RIA services Pin
Mark Salsbery10-Dec-09 13:14
Mark Salsbery10-Dec-09 13:14 
In the current RIA services, DomainContext queries ALWAYS return
a collection of entities, not a single entity.

A collection will not have the "LastName" property on it...
that's a property of your entity class (I'd assume Smile | :) )

First, if you haven't already, upgrade to the latest WCF RIA
services (here: WCF RIA Services[^])

Then your code behind could be changed to something like this:
using System.Linq;  // needed for Entities.FirstOrDefault()!

...

    SellerDomainContext domainContext = new SellerDomainContext();
    domainContext.Load(domainContext.GetSellerByUsernameQuery("joe_seller"), getSellerByUsernameLoadOp_Completed, null);

...
	
    void getSellerByUsernameLoadOp_Completed(LoadOperation loadOperation)
    {
        if (loadOperation.HasError)
        {
            loadOperation.MarkErrorAsHandled();

            // do some error handling here
        }
        else
        {
            SellerGrid.ItemsSource = loadOperation.Entities;
            FirstName.DataContext = loadOperation.Entities.FirstOrDefault();
            LastName.DataContext = loadOperation.Entities.FirstOrDefault();
        }
    }


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Databinding to simple controls with RIA services Pin
RB@Emphasys11-Dec-09 3:26
RB@Emphasys11-Dec-09 3:26 
QuestionDownload dynamic data with Silverlight app Pin
thrakazog10-Dec-09 7:06
thrakazog10-Dec-09 7:06 
AnswerRe: Download dynamic data with Silverlight app Pin
Mark Salsbery10-Dec-09 7:22
Mark Salsbery10-Dec-09 7:22 
GeneralRe: Download dynamic data with Silverlight app Pin
thrakazog10-Dec-09 7:32
thrakazog10-Dec-09 7:32 
GeneralRe: Download dynamic data with Silverlight app Pin
Mark Salsbery10-Dec-09 7:36
Mark Salsbery10-Dec-09 7:36 
QuestionRounded ListBox Pin
shanmugarajaa9-Dec-09 20:03
shanmugarajaa9-Dec-09 20:03 
AnswerRe: Rounded ListBox Pin
Mark Salsbery9-Dec-09 20:09
Mark Salsbery9-Dec-09 20:09 
GeneralRe: Rounded ListBox Pin
shanmugarajaa9-Dec-09 22:13
shanmugarajaa9-Dec-09 22:13 
GeneralRe: Rounded ListBox Pin
Mark Salsbery10-Dec-09 6:34
Mark Salsbery10-Dec-09 6:34 
QuestionWPF OpenFileDialog and FolderBrowserDialog Pin
ausadmin9-Dec-09 8:47
ausadmin9-Dec-09 8:47 
AnswerRe: WPF OpenFileDialog and FolderBrowserDialog Pin
Mark Salsbery9-Dec-09 10:22
Mark Salsbery9-Dec-09 10:22 
GeneralRe: WPF OpenFileDialog and FolderBrowserDialog Pin
Pete O'Hanlon9-Dec-09 10:59
mvePete O'Hanlon9-Dec-09 10:59 
GeneralRe: WPF OpenFileDialog and FolderBrowserDialog Pin
ausadmin31-Jan-10 10:04
ausadmin31-Jan-10 10:04 
QuestionMVVM newbie question - this doesn't seem to work with databinding Pin
Judah Gabriel Himango9-Dec-09 7:37
sponsorJudah Gabriel Himango9-Dec-09 7:37 
AnswerRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Ian Shlasko9-Dec-09 8:10
Ian Shlasko9-Dec-09 8:10 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Judah Gabriel Himango9-Dec-09 8:11
sponsorJudah Gabriel Himango9-Dec-09 8:11 
GeneralRe: MVVM newbie question - this doesn't seem to work with databinding Pin
Ian Shlasko9-Dec-09 8:14
Ian Shlasko9-Dec-09 8:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.