Skip to main content

Posts

Showing posts with the label WPF

mvvm double click event in listview

If you want to get the double click event on a listview item you can try with this code; <ListView Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Width="250" Height="200" HorizontalAlignment="Stretch" VerticalAlignment="Top" AlternationCount="2" BorderBrush="#FFA8CC7B" ItemContainerStyle="{StaticResource alternatingStyle}" ItemsSource="{Binding FromPayerNameList}" SelectedItem="{Binding SelectedFromPayer, Mode=TwoWay}"> <ListView.ItemTemplate> <DataTemplate> <TextBlock Width="{Binding Path=ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListView}}}" Text=...

WPF Devexpress Datagrid checkbox binding

We can easily bind the checkbox on devexpress datagrid <dxgcore:GridColumn Width="20" AllowEditing="True" Binding="{Binding Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="R" Visible="{Binding CheckboxSelection}" VisibleIndex="6"> <dxgcore:GridColumn.CellTemplate> <DataTemplate> <dxe:CheckEdit HorizontalAlignment="Center" VerticalAlignment="Center" Command="{Binding Path=View.DataContext.IsCheckedCommand}" CommandParameter="{Binding RowData.Row}" IsChecked="{Binding RowData.Row.IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ...

devexpress wpf gridcontrol disable context menu

If you want to disable any context menu item in devexpress grid like this. In XAML <dxg:GridControl x:Name="grdProfile" Width="1070" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top" AutoGenerateColumns="None" ItemsSource="{Binding CusHisViewRefillHistoryList}" SelectedItem="{Binding SelectedCusHisViewRefillHistory}"> <dxg:GridControl.Columns> <dxg:GridColumn Width="100" Binding="{Binding RxNo}" Header="Rx #" /> <dxg:GridColumn Width="70" Binding="{Binding PhInitials}" Header="Ph. Initials" /> ...

WPF mvvm passing popup viewmodel value in to main viewmodel

I have a scenario that I have a WPF usercontrol UI, from this UI I will call a pop up usercontrol UI. When I will select a value from pop up usercontrol UI Grid, then popup ui will be close and the selected popup grid value will get in main UI without visual state change of the main UI.  Main UI ViewModel: private void OnInsplanPicker(object sender) { InsurancePlanLookup window = new InsurancePlanLookup(); window.BindEvent += window_BindEvent; DockHelper.AddPanel(window,"Insuranceplan lookup"); } void window_BindEvent(long insplanId) { Nhinsplanid_FK = insplanId; } Popup code behind public partial class InsurancePlanLookup { public delegate void BindDelegate(long insplanId); public event BindDelegate BindEvent; VMInsurancePlanLookup vm ; public InsurancePlanLookup() { InitializeComponent(); vm = new VMInsurancePl...