Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <DataGridTemplateColumn Header="Валюта">
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Path=ExchangeRates.Title}"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- <DataGridTemplateColumn.CellEditingTemplate>
- <DataTemplate>
- <ComboBox ItemsSource="{Binding Path=DataContext.ExchangeRates,
- RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
- SelectedItem="{Binding Path=ExchangeRates, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- DisplayMemberPath="Title" IsSynchronizedWithCurrentItem="True"/>
- </DataTemplate>
- </DataGridTemplateColumn.CellEditingTemplate>
- </DataGridTemplateColumn>
- /*ExchangeRates коллекция для ComboBox
- Тут была попытка получить элемент из коллекции и потом его поставить в качестве выбранного(не помогло)
- ModelModul.ExchangeRates ex = ExchangeRates.Single(objEx =>
- objEx.Id == product.ExchangeRates.Id);
- ExchangeRates.Contains(ex) хотя тут вернул true*/
- PurchaseInfos.Add(new PurchaseInfos
- {
- Products = new Products
- {
- Barcode = product.Barcode,
- Groups = product.Groups,
- //ExchangeRates = ex,
- ExchangeRates = product.ExchangeRates,
- Id = product.Id,
- IdExchangeRate = product.IdExchangeRate,
- IdGroup = product.IdGroup,
- IdUnitStorage = product.IdUnitStorage,
- IdWarrantyPeriod = product.IdWarrantyPeriod,
- PurchasePrice = product.PurchasePrice,
- SalesPrice = product.SalesPrice,
- VendorCode = product.VendorCode,
- UnitStorages = product.UnitStorages,
- WarrantyPeriods = product.WarrantyPeriods,
- Title = product.Title,
- SerialNumbers = new ObservableCollection<SerialNumbers>()
- },
- IdProduct = product.Id,
- IdExchangeRate = product.IdExchangeRate,
- ExchangeRates = product.ExchangeRates
- });
- public override bool Equals(Object obj)
- {
- if (obj == null || !GetType().Equals(obj.GetType()))
- {
- return false;
- }
- return Id == ((ExchangeRates)obj).Id &&
- Title == ((ExchangeRates)obj).Title && Course == ((ExchangeRates)obj).Course;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement