CRM 2011 - Binding Lookup Value with Silverlight DataGrid

Answered CRM 2011 - Binding Lookup Value with Silverlight DataGrid

  • 3. října 2011 22:21
     
     

    Hi Forum,

    I am following example from CRm 2011 SDK under Sample Code > cs > silverlight > RestSilverlightContactEditor.

    It works fine as it has explained in Read Me document.

    In this example everything is bind with text field of the contact entity with the Silverlight DataGrid. But I want to bind value of the lookup field. (for example, parent customer)

    How do I get value of lookup on Silverlight DataGrid as shown in below image.  I have tried to replace address field with parencustomerid field but its showing text value of object like "RestSilverlightContactEditor.CrmOdataService.EntityReference" in grid column instead of Parent Accoun Name.

    Thanks.

     

     



    • Upravený H.Desai 3. října 2011 22:22
    • Upravený H.Desai 4. října 2011 0:04
    •  

Všechny reakce

  • 4. října 2011 0:16
     
     Odpovědět

    After some playing I found that you have to change the binding property like this.

    <sdk:DataGridTextColumn x:Name="AccountTxt" Header="ZIP" Binding="{Binding Path=parentcustomerid.Name, Mode=TwoWay}" />

    This will show Account name rather than "RestSilverlightContactEditor.CrmOdataService.EntityReference"

    Cheers
    • Upravený H.Desai 4. října 2011 0:17
    • Označen jako odpověď H.Desai 4. října 2011 0:17
    •  
  • 16. května 2012 6:00
     
     

    hi H.Desai,

    Similar scenario i have with optionset and currency field... so what is  binding property for optionset and currency field.

    this is my currency (money)field declared in gridview:

    <

    sdk:DataGridTextColumn x:Name="RateTxt" Header="Rate" Binding="{Binding Path=new_rate, Mode= OneWay}" IsReadOnly="True" />erorr is :"RestSilverlightContactEditor.CrmOdataService.Money"

    Gangadhar

    Please let me know..
    • Upravený Gangadhar.G 16. května 2012 6:01 change
    •