Find out index of GridView SelectedRow after user choose GridView filtering

1 posts, 0 answers
  1. Naseem
    Naseem avatar
    70 posts
    Member since:
    Nov 2010

    Posted 10 Feb 2013 Link to this post

    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
Back to Top