diff --git a/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml b/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml index e6d6369..e705976 100644 --- a/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml +++ b/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml @@ -23,7 +23,7 @@ - + diff --git a/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml.cs b/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml.cs index af5cc81..b04da51 100644 --- a/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml.cs +++ b/SCCMCliCtrWPF/SCCMCliCtrWPF/Controls/InstalledSoftwareGrid.xaml.cs @@ -132,6 +132,25 @@ private void ContextMenu_Opened(object sender, RoutedEventArgs e) } } } + + private void dataGrid1_KeyDown(object sender, KeyEventArgs e) + { + DataGrid dataGrid = sender as DataGrid; + if (dataGrid.Items.Count == 0 || e.Key < Key.A || e.Key > Key.Z) + { + return; + } + + foreach(sccmclictr.automation.functions.inventory.AI_InstalledSoftwareCache oItem in dataGrid.Items) + { + if (oItem.ARPDisplayName.StartsWith(e.Key.ToString(), StringComparison.CurrentCultureIgnoreCase)) + { + dataGrid.SelectedItem = oItem; + dataGrid.ScrollIntoView(dataGrid.SelectedItem); + return; + } + } + } } public class SWListConverter : IValueConverter