Hope someone can help me with this issue that I'm facing right now.
I'm trying to implement some behaviours in calculated columns (which are not Expression columns by the way). The goal is to have the last column value returned by the business layer based in the other column values.
I'm actually setting the DataContext as a DataView (DataTable.DefaultView), but when I try to programmatically make any change to the DataContext, the last column value doesn't actually refresh (visually) until I change to another row.
I thought that using DefaultView, and since it implements the INotifyPropertyChanged, the row being edited would be refreshed automatically. But in fact that doesn't happen in this case.
Converters and Expression columns are not exactly an option (at least I think so), since I send the grid's DataContext back to my Business layer where I set the last column value for each row.
Help would be extremely appreciated.
4 Answers, 1 is accepted
It would be really helpful if you could reveal additional details about your solution. How are the values of the calculated column generated?
All the best,
the Telerik team
The problem was that while I was changing a certain column value, there's a special column that I want to be updated once I leave the cell edit mode. I found that using the DefaultView I couldn't get the radgrid UI to be updated.
Then I came out with this solution: creating my own table by inheriting DataTable and implementing INotifyPropertyChanged on my own DataRow. The grid's DataContext is now set to the MyTable instead of its DefaultView.
And in fact now I get the behavior I was looking for...except now I cannot insert new rows with the ShowInsertRow option !
Any ideas on how I can fix this ? I'm really trying to avoid creating a button or a context menu option for the user to be able to insert a new row...
Please let me know if you need some more details.
You could try the following approach:
AddingNewdataItem should be used since the grid does not know how to create a new DataRow. One the data is created you should used RowEditEnded event to commit the new data.
the Telerik team
I've followed your approach and it worked great.