Datagridview bound checkbox column - with check all not working

0
0

I have a sortableBindingList(of Order) as the datasource to a datagridview.

The Order object has a isSelected boolean property.

dim lst as new sortableBindingList(of object)

fill list….

datagridview.datasource = lst

 

I also have a “check all” button.  When I press the button, I want to loop through the list and set the property

for each row in lst

row.isSelected = true

next

datagridview.datasource = lst

 

The property is getting set in the sortableBindingList(of order) but the checkboxes in the datagridview don’t change.

I am not sure what I am doing wrong.

Note: I am using the SortableBindingList because that is how I do it in our WinForm application.  If I should not be  using a SortableBindingList let me know.

Thanks,

Shawn R

  • You must to post comments
0
0

Well, that was easy!

That got me going.  I had forgotten about the .Refresh() command.
Thanks much Levie!
Shawn R
  • You must to post comments
0
0

Here is a sample app that has the problem.

Attachment
  • Levie (ITG)
    Hi Shawn, you can use DataGridView.Refresh() to force a refresh of the DataSource in the DataGridView. A SortableBindingList is fine to use. I’m not sure how many (or complex) WinForms applications you’re moving to the web, but you might be interested in this: https://iceteagroup.com/winforms-modernization/. If you have any other issues or questions, let us know! -Levie
  • You must to post comments
0
0

Hi Shawn,

Can you please wrap up a small sample for us to check ?

Thank you,

Alaa

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.