I just upgraded to the newest release and I'm geting an exception in this code now. This code has been working fine with the previuous relases for months. e.Cell.DataContext is now null. Did I miss a breaking change?
private void Grid_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e) {
MyObject myObj = e.Cell.DataContext as MyObject;
..
.
..
}
private void Grid_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e) {
MyObject myObj = e.Cell.DataContext as MyObject;
..
.
..
}
4 Answers, 1 is accepted
0
Hello Nathaniel,
Maya
the Telerik team
Generally, the DataContext of the cell will be the underlying data item. I have tested the code-snippet you gave and everything works properly without throwing any exceptions. Would you clarify a bit more whether there is something else that needs to be done in order to get the same behavior as you ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Nathaniel
Top achievements
Rank 1
answered on 29 Nov 2011, 01:23 PM
The casting of the datacontext to myObj does not raise an exception, but when i try to access a property of myObj it raises the exception because the object is null.
0
Nathaniel
Top achievements
Rank 1
answered on 05 Dec 2011, 01:46 PM
Maya,
Do i need to provide more info or is this a forgotten issue. This problem is preventing me from upgrading to the latest release. Should I stop using the CellEditEnded event?
Do i need to provide more info or is this a forgotten issue. This problem is preventing me from upgrading to the latest release. Should I stop using the CellEditEnded event?
0
Hi Nathaniel,
Maya
the Telerik team
I am sending you the sample project I used for testing the case. Could you take a look at it and let me know whether you can reproduce the behavior on it ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>