Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

"Page UP" KeyBoard key is not working properly on DataGrid in WPF

$
0
0

Hi All,

I am working on custom DataGrid (extended DataGrid of WPF). I am facing a problem as follows -

1. If I create more than 500 rows on the Datagrid and focus is on cell of 500th row. If I pressed "Page Up"                               key of keyboard, it works fine for 6-7 times (means DataGrid shows correct rows, focus also shifted), but problem is             that after pressing "Page Up" key for 7-8 times, it is coming to origin position on DataGrid where I started to press             "Page Up" key (Means 500th row).

Code is as follows -

 <DataGrid Name="StandardDG"
                           CanUserAddRows="False"
                           CanUserDeleteRows="False"
                           ItemsSource="{Binding Collection}"
                           SelectedItem="{Binding SelectedItem}"
                           IsAlwaysInEditMode="False"
                           Margin="8,10,8,10"
                           RowStyleSelector="{StaticResource customStyleSelector}"
                           RowHeaderWidth="23"
                           RowHeight="23"
                           SelectionMode="Single"
                           CanUserResizeRows="False"
                           VirtualizingStackPanel.VirtualizationMode="Standard"
                           BeginningEdit="DG_BeginningEdit"
                           SelectionChanged="DG_SelectionChanged">

<DataGrid>

I don't know why this is happening. Please suggest me solution ?

Thnaks in advance.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>