views:

47

answers:

3

I have a strange problem with a DataGridView I'm using which is bound to a table in VB.net

I've added a checkbox column to allow a user to tick a bunch of rows that I can then loop through and save off to a different table. All the checkboxes are enabled by default. So it's really a case of unchecking the rows which aren't required.

However, the DataGridView re-enables any checkbox that I click after I click on a checkbox in another row. So in effect, only one row can be unchecked at a time.

I'm sure I'm probably missing something obvious here?

EDIT: I forgot to mention this is a Windows form, not an ASP.net application.

A: 

I think this is what is happening. Please check if you have checked IsPostback while binding the datagridview. I think the click event of the checkbox is initiating a postback and it is rebinding itself.

HTH

Raja
A: 

I think the grid is refreshing and then redrawing the default values...

eschneider
A: 

I got it working in the end, although I'm not sure exactly how. It must have been some property that I tweaked in the grid

SuperFurryToad