In my Silverlight application I have a RadCalendar and a RadGridView. As the user selects new dates in the RadCalendar, new data is requested asynchronously from the ADO.Net dataservice.
The RadGridView is also displaying a RowDetailView when an row is selected. In the RowDetailView, I want the user to be able to edit a couple of the fields and have those changes reflected back in the main view of the RadGridView. However, any changes made in the RowDetailView are not reflected in the RadGridView. If you changing to another row and then back to the row that the changes were made on, the RowDetailView still has the "changed" data.
My question is how do I get those changes to show up in the main RadGridView after making changes in the RowDetailView?
Here is my RadGridView definition:
<telerikGridView:RadGridView x:Name="routeStop" |
IsReadOnly="False" AutoGenerateColumns="False" ShowGroupPanel="False" EnableColumnVirtualization="False" |
SelectionChanged="routeStop_SelectionChanged" |
RowDetailsVisibilityMode="VisibleWhenSelected" RowDetailsTemplate="{StaticResource RouteStopInfoDetailsTemplate}" AreRowDetailsFrozen="True" RenderTransformOrigin="0.5,0.5" > |
<telerikGridView:RadGridView.Columns> |
<telerikGridView:GridViewDataColumn Header="Stop" UniqueName="Stop"> |
</telerikGridView:GridViewDataColumn> |
<telerikGridView:GridViewDataColumn Header="Master BOL" UniqueName="MasterBOL"> |
</telerikGridView:GridViewDataColumn> |
<telerikGridView:GridViewDataColumn Header="Supplier Code" UniqueName="SupplierCode" > |
</telerikGridView:GridViewDataColumn> |
<telerikGridView:GridViewDataColumn Header="ShipFrom" UniqueName="ShipFrom"> |
</telerikGridView:GridViewDataColumn> |
<telerikGridView:GridViewDataColumn Header="Trailer" UniqueName="TrailerNumber"> |
</telerikGridView:GridViewDataColumn> |
<telerikGridView:GridViewDataColumn Header="SCAC" UniqueName="TrailerScac"> |
</telerikGridView:GridViewDataColumn> |
</telerikGridView:RadGridView.Columns> |
</telerikGridView:RadGridView> |
Here is my code to request the data from the ADO.Net Dataservice:
private void UpdateRouteStopView() |
{ |
routeStop.IsBusy = true; |
DateTime selectedDateTime = calendarControl.SelectedDate.Value; |
var query = (from asnInMaster in dbContext.AsnInMaster |
where asnInMaster.ETA >= selectedDateTime && asnInMaster.ETA <= selectedDateTime.AddDays(1.0) && asnInMaster.Route == selectedRoute |
orderby asnInMaster.Stop |
select asnInMaster); |
var dsQuery = (DataServiceQuery<AsnInMaster>)query; |
dsQuery.BeginExecute(RouteStopCallback, dsQuery); |
} |
private void RouteStopCallback(IAsyncResult asyncResult) |
{ |
try |
{ |
DataServiceQuery<AsnInMaster> query = asyncResult.AsyncState as DataServiceQuery<AsnInMaster>; |
routeStop.ItemsSource = query.EndExecute(asyncResult).ToList(); |
} |
catch |
{ |
} |
finally |
{ |
routeStop.IsBusy = false; |
} |
} |
And here is the definition of my RowDetailView:
<Grid x:Name="detailsGrid" Height="300"> |
<Grid.RowDefinitions> |
<RowDefinition Height="30"/> |
<RowDefinition Height="20"/> |
<RowDefinition Height="20"/> |
<RowDefinition Height="20"/> |
<RowDefinition Height="20"/> |
<RowDefinition Height="20"/> |
</Grid.RowDefinitions> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="Auto" /> |
<ColumnDefinition Width="Auto" /> |
<ColumnDefinition Width="30" /> |
<ColumnDefinition Width="Auto" /> |
<ColumnDefinition Width="Auto" /> |
<ColumnDefinition Width="30" /> |
<ColumnDefinition Width="30" /> |
</Grid.ColumnDefinitions> |
<TextBlock Text="Route Stop Details Information" FontWeight="Bold" FontFamily="Comic Sans MS" FontSize="18" |
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"/> |
<!-- Column 0 & 1 Definitions --> |
<TextBlock Text="ASN MasterID: " Margin="0,0,0,0" FontWeight="Bold" |
Grid.Row="1" Grid.Column="0" /> |
<TextBox Text="{Binding AsnInMasterID}" Margin="0,0,0,0" Grid.Row="1" |
Grid.Column="1"/> |
<TextBlock Text="Master BOL: " Margin="0,0,0,0" FontWeight="Bold" |
Grid.Row="2" Grid.Column="0" /> |
<TextBox x:Name="masterBOL" Text="{Binding MasterBOL, Mode=TwoWay}" Margin="0,0,0,0" Grid.Row="2" |
Grid.Column="1" /> |
<TextBlock Text="Supplier Code: " Margin="0,0,0,0" FontWeight="Bold" |
Grid.Row="3" Grid.Column="0" /> |
<TextBox Text="{Binding SupplierCode, Mode=TwoWay}" Margin="0,0,0,0" Grid.Row="3" |
Grid.Column="1" /> |
<TextBlock Text="ShipFrom: " Margin="0,0,0,0" FontWeight="Bold" |
Grid.Row="4" Grid.Column="0" /> |
<TextBox Text="{Binding ShipFrom}" Margin="0,0,0,0" Grid.Row="4" |
Grid.Column="1" /> |
<!-- Column 3 & 4 Definitions --> |
<TextBlock Text="Trailer #: " Margin="0,0,0,0" FontWeight="Bold" |
Grid.Row="1" Grid.Column="3" /> |
<TextBlock Text="{Binding TrailerNumber}" Margin="0,0,0,0" Grid.Row="1" |
Grid.Column="4"/> |
<TextBlock Text="SCAC: " Margin="0,0,0,0" FontWeight="Bold" |
Grid.Row="2" Grid.Column="3" /> |
<TextBlock x:Name="SCAC" Text="{Binding TrailerScac}" Margin="0,0,0,0" Grid.Row="2" |
Grid.Column="4" /> |
</Grid> |
Any help would be greatly appreciated.