This is a migrated thread and some comments may be shown as answers.

[Solved] Interface as Key for Grid

0 Answers 7 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fábio
Top achievements
Rank 1
Fábio asked on 10 Oct 2011, 05:55 PM
Hi,

I'm facing a problem at the project I'm currently working at, considering we don't reference Models directly and I need to access an inner object property as the key for my grid.

Here we have our Models referenced by Interfaces on other models. 
Ex:
public class Client : FilteredEntity<Client, IClientService>, IClient
{
   public virtual IAddress Client { get; set; }
}

Supposing that I need the IAddress.AddressId as the key of my Telerik MVC grid, it always says it's null and don't even call my Controller.

@{Html.Telerik().Grid<Client>()
    .Name("GridClient")
    .DataKeys(keys =>
    {
        keys.Add(c => c.Address.AddressId);
    })


Is there a way to bypass this and use an inteface's property as key?

Thanks in advance!


Regards!

Tags
Grid
Asked by
Fábio
Top achievements
Rank 1
Share this question
or