Gridview with herarchical data. I need to be able get a value from a column from the selected row in the master template and a different column and row in the child template, how do i add a check to see which template the row selected is on using the gridview click event?
1 Answer, 1 is accepted
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Sep 2014, 08:49 AM
Hello Mr Smith,
Thank you for writing.
You can determine to which template the clicked cell belongs to via the GridViewCellEventArgs.Row.HierarchyLevel property. Here is a sample code snippet, demonstrating how to get the appropriate template:
MasterGridViewTemplate masterTemplate = e.Row.ViewTemplate as MasterGridViewTemplate;
}
else if (e.Row.HierarchyLevel == 1)
{
//first level template
GridViewTemplate template = e.Row.ViewTemplate;
}
}
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Desislava
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.