That sounds tricky. My first attempt at something like this would be to determine if the Grid control actually knows which rows are “highlighted”. Without that info, I don’t know how any other code or process would know which rows of the dataview need that checkbox field updated.
Just started doing some testing and it looks like it might not be that hard. At the moment, I have a button that when pressed, will tell you how many rows of a specific grid are selected
from Calvin’s example will give a collection of selected rows(pretty reliable in my exp.). You can loop over this collection of rows and use the current selected row’s index(in the overall collection) to do something(like set buy to true).
One option would be an event handler that listens when the buy value changes for a single row(the users clicks it). In the handler, loop over all selected rows and select buy for them as well.
Alternately, you could add a button(named something like ‘Buy Selected’ and handle the click event of the button and loop over the selected rows and… yada yada.
You can loop through the all rows using a foreach, and if selected (it’s a property on the row) check the box on the current row. I’ve done it many times.