I'm using a VB power packs data repeater control. I need to bind a list of custom objects to labels inside the repeater. The following code works except for the Tip.User.UserName binding.
How can I bind to a property of an Inner class like Tip.User.UserName
public interface ITip
{
DateTime Date { get; set; }
int Id { get; set; }
int UserId { get; set; }
User User { get; set; }
Group Group { get; set; }
}
public interface IUser
{
string DisplayName { get; set; }
string UserName { get; set; }
}
List<Tip> currentTips = SearchTips(toolTxtSearch.Text, Convert.ToInt32(toolCmbTipGroups.ComboBox.SelectedValue));
lblTipId.DataBindings.Add(new Binding("Text", currentTips, "Id"));
lblTipUser.DataBindings.Add(new Binding("Text", currentTips, "User.UserName")); // this line doesnot work !!!
repeater.DataSource = currentTips;