wpf - Wrong index after re-ordering datagrid rows -
i have data table bound data grid, , when re-order rows, index of string i'm looking gets messed up.
i index of serial num column... works, after i've moved it.
dim snindex integer = asset_masterdatagrid.columns.[single](function(c) c.header.tostring() = "serial num").displayindex then direct cast row i'm clicking
dim item datarowview = directcast(asset_masterdatagrid.selecteditem, datarowview) then grab string of cell in serial num column.
dim sn string = item.row(snindex)
of course doesn't work, , when re-order serial number column lets say... index 0, grabs asset id cell string. i'm trying find serial number of whatever row click on, no matter serial number column is.
any ideas on how correct issue?
you can access column of datarowview name rather index:
dim item datarowview = directcast(asset_masterdatagrid.selecteditem, datarowview) dim sn string = item("serial num") this should work provided know name of serial number column.
Comments
Post a Comment