wpfdatagrid - Unable to perform Up-down operation when wpf datagrid is sorted -


Hi,

I have a Datgrid (WPF Toolkit) that is tied in an observation archive.

Two buttons are "up" and "down", which move the selected row accordingly. For example: If the datagrid has 10 items and if I select the fourth object and press the "up" arrow then the 4th item will be taken to the third item and the last third item will be the 4th object. Ie swapping with the previous item similarly "down" arrows in another way.

Private Zero BtnUpArrowClick (Object Sender, RoutedEventArgs E) {

  try {btnDownArrow.IsEnabled = true; CurrentRow = grdSeqData.SelectedIndex; If (currentRow == 0) {btnUpArrow.IsEnabled = false; } (CurrentRow = upRow;} and {btnUpArrow.IsEnabled = false;}}} Hold (Exception preceded) and (upRow = currentRow - 1; if (upRow> = 0) {sequence datatyst. {CatchExeption (LanguageHandler.GetCurrentCultureText ("EventUpArrow_Exception"), former);}}  

The above code is fine when the datagrid is not sorted, when I sort the datagrid via header click , And then do the "up" or "down" operation, nothing in the data grid appears

This view is being solved My compiled collection remains the same, so I tried to look at the compilation with the view but in vain.

ICollectionView View = archive ViewSource.GetDefaultView (grdSeqData.ItemsSource) as ListCollectionView; see Main StatementTownbook ();

I think that when datagrid sort-decree is implemented, the view will not run accordingly. Please help.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -