In the event handler of RecordExpanding, how do I get first cell's value?
Thanks!
Hello,
Have you tried :
(e.Record as DataRecord).Cells[0].Value
Alex.
Thanks Alex, but I got Error 1 'System.Windows.RoutedEventArgs' does not contain a definition for 'Record' and no extension method 'Record' accepting a first argument of type 'System.Windows.RoutedEventArgs' could be found (are you missing a using directive or an assembly reference?) C:\download\testColorLine\testColorLine\testColorLine\Window1.xaml.cs 70 25 testColorLineprivate
void expandingHandle(object sender, RoutedEventArgs e) { var xx = (e.Record as DataRecord).Cells[0];}Steve
Hello Steve,
the problem is in the handle
it should be like this:
private void expandingHandle(object sender, Infragistics.Windows.DataPresenter.Events.RecordExpandingEventArgs e) {
}
Hi Alex, It works! Thanks a lot!By thwe way, If I want to do it in MVVM way, how to bind RecordExpanding to a property in the ViewModel file.
Steve
First thing that comes in my mind is using the IsExpanded property of the record and bind it to it.
Perhaps it is better to take a look at Josh Smith's blog
http://joshsmithonwpf.wordpress.com/ and his article about it here:
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
Hi AlexCould you pelase porvide more info how to do bind to Record's property or provide a simple sample?Thanks!Steve
It is a property of the Record
Alex, But I can't find IsExpanded property under XamDataGrid.
Thanks!Steve