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

[Solved] Bind RowDetails in LoadRowDetails failing

1 Answer 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alessandro
Top achievements
Rank 1
Alessandro asked on 08 Feb 2011, 12:21 AM
I need to bind the the contents of the RowDetailsTemplate (which is a user control) to an object that is contained by the object to which the Grid is bound.  I tried doing this in the LoadRowDetails event handler, but when I do, expanding the view does not work.  This is what I am doing in the event handler:

private void DetailsGrid_LoadingRowDetails(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
{
    BaseUserControl baseUserControl = e.DetailsElement as BaseUserControl;
    Link link = baseUserControl.DataContext as Link;
    if (link is LinkIncidentToPerson)
    {
        e.DetailsElement.DataContext = ((LinkIncidentToPerson)link).Incident;
      
    }
}

As I said, the code doesn't fail but I can no longer expand the row details. Any ideas what I'm doing wrong? Is there a different approach to what I need to do?  Thanks.
 -- xavier

1 Answer, 1 is accepted

Sort by
0
Alessandro
Top achievements
Rank 1
answered on 08 Feb 2011, 12:32 AM
Never mind, there was an error in my code. I have resolved the issue. thanks!
Tags
GridView
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Alessandro
Top achievements
Rank 1
Share this question
or