This is a migrated thread and some comments may be shown as answers.

Find out index of GridView SelectedRow after user choose GridView filtering

0 Answers 67 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Naseem
Top achievements
Rank 1
Naseem asked on 11 Feb 2013, 12:38 AM
Hi,

I'm looking for a way to get the index of GridView SelectedRow after user sort columns. Here is the scenario

1. User specify some filterrings on some columns (eg. Sort some columns)
2. User select any rows
3.Now I need to find out the index of selectedRow. The problem is that my collection and also GridView.ItemSource are not sorted based on GridView filtering, So because of that bellow line doesn't give me the correct index.

int ProcessedIndex = BadRawCollection.IndexOf(BadRawCollection.Where(x => x.Code == ((BadRawItem)GridViewPrd.SelectedItem).Code).FirstOrDefault());
 
Than you in advace for your help,

Kind Regards,
Naseem
Tags
GridView
Asked by
Naseem
Top achievements
Rank 1
Share this question
or