datagrid and data bound datatable

Discussion in 'Software' started by Burning_Monkey, Sep 26, 2007.

  1. Burning_Monkey

    Burning_Monkey MajorGeek

    Here is the issue;

    I have a datagrid that has a datatable bound to it. If the grid is unsorted I can detect all the rows that the user selects if the user multi selects rows. The issue comes when the datagrid gets sorted on a column. Then the datatable some how becomes "unbound" or unsorted and the two no longer line up correctly. ie, some one sorts on column 1 then selects rows 1, 2, and 3. These rows are not the same as the unsorted rows 1, 2, and 3. Since I need to know the sorted selected rows, this causes some issues for me.

    Any help would be appreciated.

    EDIT: This is all done in C#
     
  2. Kodo

    Kodo SNATCHSQUATCH

    that's correct. The indexing for the rows has been changed when you sort. what you probably want to do is maintain a list<T> of selected rows.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds