I think Ryan means here as if you had such an object
public class Person { public string FirstName { get; set; } public string LastName { get; set; } }
And if you bind a Person object anywhere in the GridView or Repeater to any DataSource, you only bind Person and get the default binding value from one of its properties. support we have the Ryan variable from Person , so I want to get the value of the variable from the call <%# Eval("Ryan") %> not <%# Eval("Ryan.FirstName") %>
I tried to put the DefaultBindingProperty attribute for the class, but it does not work
[System.ComponentModel.DefaultBindingProperty("FirstName")] public class Person { public string FirstName { get; set; } public string LastName { get; set; } }
Does anyone know how to do this correctly?
Ahmed magdy
source share