currentitem

DataGrid CurrentItem != SelectedItem after reentry with tab-button

流过昼夜 提交于 2020-01-12 19:16:29
问题 This simple WPF-DataGrid <DataGrid AutoGenerateColumns="False" Height="300" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="dgOriginal" Margin="4,12,0,0" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" IsSynchronizedWithCurrentItem="True" CanUserSortColumns="False" SelectionMode="Single" SelectionUnit="FullRow"> <DataGrid.Columns> <DataGridCheckBoxColumn x:Name="col2Checked"/> <DataGridTextColumn x:Name="col2Name"/> <DataGridTextColumn x:Name=

ICollectionView cancel currentchanging

血红的双手。 提交于 2019-12-11 01:06:31
问题 I am looking for a way to cancel the CurrentChanging event depending on the item that was clicked. In my application I use ICollectionView to hold my list of viewmodels which are rendered as tabitems in a tabcontrol. For a specific viewmodel I need to do some property checking before the viewmodel can be activated. In order to do that I need to now that the specific viewmodel is going to be the next current item. Depending on the results of the property checking, the change of the current

Binding to CurrentItem in a ItemsControl

二次信任 提交于 2019-12-04 04:21:25
问题 The XAML below is basically trying to make a list of Button s (rendered from the Name property of objects in the Views collection in the current DataContext . When I click on a button the CurrentItem property of CollectionViewSource should change and the associated View should be displayed in a content presenter. OK. If I click in the ListBox in the XAML below it works exactly as desired. But, If I click a button in the UniformGrid (created by the items control) the CurrentItem property is