Hi,
I have a problem with GridView (2012.1.326.40):
<telerik:RadGridView CanUserSortColumns="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Name="ProductionQuantityTable" IsSynchronizedWithCurrentItem="True"
grid:RadGridViewHelper.ColumnsCollection="{Binding Path=ColumnsCollection, NotifyOnSourceUpdated=True}" SelectedItem="{Binding SelectedQuantity, Mode=TwoWay}" SelectionMode="Single" ItemsSource="{Binding Quantities}" />
ViewModel:
private ProductionQuantityItemViewModel _selectedQuantity;
public ProductionQuantityItemViewModel SelectedQuantity
{
get
{
if (_selectedQuantity == null && _project.CurrentQuantityVariantId.HasValue)
{
_selectedQuantity = _quantities.FirstOrDefault(q => q.QuantityVariant.Identity == _project.CurrentQuantityVariantId.Value);
}
return _selectedQuantity;
}
set
{
_selectedQuantity = value;
_project.CurrentQuantityVariantId = _selectedQuantity.QuantityVariant.Identity;
RaisePropertyChanged(() => SelectedQuantity);
_eventAggregator.GetEvent<ProductionQuantityChangedEvent>().Publish(_selectedQuantity.QuantityVariant.ProductionQuantity);
}
}
SelectedItem is binding to ViewModel, but when I set SelectedQuantity in ViewModel I don't get any graphical representation in UI.
What I'm trying to achieve is that when I load table that row is selected (based on data in DB). In this example row #2.
http://gyazo.com/38e88488d872989beb03b447a6e545d6