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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:39:03+00:00 2026-05-13T23:39:03+00:00

I have an anonymous linq query that I bind to a datagrid, when I

  • 0

I have an anonymous linq query that I bind to a datagrid, when I debug it brings alright the data but it doesn’t show in the datagrid, I suspect that the request to RIA services isn’t completed before I bound it to the datagrid. I could use the LoadOperation<>() Completed event. But it only works with Defined Entities so how can I do that?
For reference here is the last post:
LINQ query null reference exception
Here is the query:

var bPermisos = from b in ruc.Permisos
                                 where b.IdUsuario == SelCu.Id
                                 select new {
                                     Id=b.Id,
                                     IdUsuario=b.IdUsuario,
                                     IdPerfil=b.IdPerfil,
                                     Estatus=b.Estatus,
                                     Perfil=b.Cat_Perfil.Nombre,
                                     Sis=b.Cat_Perfil.Cat_Sistema.Nombre

                                 };

I’m a totally newbie sorry if is a very simple question.

Thanks!!

  • 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-13T23:39:04+00:00Added an answer on May 13, 2026 at 11:39 pm

    Silverlight 3 doesn’t support data binding to anonymous types.

    You need to create a simple class to put your properties into.

    Here is the ValueConverter technique:

    namespace SilverlightApplication55
    {
        using System;
        using System.Windows;
        using System.Windows.Data;
    
        public class NamedPropertyConverter : IValueConverter
        {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null || parameter == null)
            {
                return null;
            }
    
            var propertyName = parameter.ToString();
    
            var property = value.GetType().GetProperty(propertyName);
    
            if (property == null)
            {
                return null;
            }
    
            return property.GetValue(value, null);
        }
    
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;        
        }
    }
    }
    

    Then you put this in your UserControl.Resources:

    <local:NamedPropertyConverter x:Key="NamedPropertyConverter"/>
    

    And this where you want to use a named parameter – pass it in with the ConverterParameter:

    <TextBlock Text="{Binding Converter={StaticResource NamedPropertyConverter}, ConverterParameter=Estatus}"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a linq query that creates the anonymous type below: select new
up till now I have a linq query that fills a datagrid perfectly with
I have a datagrid populated by a Linq query. When the focused row in
I have a LINQ query that uses lambda syntax: var query = books .Where(book
I have a fairly complicated linq query that returns an item and a string[]
I have a Linq Group By query that works. Here's the query: Dim query
I have been using anonymous namespaces to store local data and functions and wanted
I have a function that accepts an anonymous function as an argument and sets
Into some view data i have put the result of an anonymous type: var
I have a linq query which returns the ID of a question based on

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.