ousoonerjoe
Programmer
Using Vb.Net 2010 SP1
I have encountered this a few times now and for the life of me do not understand what is happening or why. I have a DataGridView named dgParts. It has multiple columns (with prefix of "dc") associated with it. I used the GUI interface to create it all. At run time the column.Index = 0 for ALL columns. When I use the column name, it works just fine.
Below is a sample of the code from the dgParts_RowEnter Event:
Any suggestions or explanations are welcome. It seems to be intermittent. Not all forms with a DGV have this issue.
--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------
I have encountered this a few times now and for the life of me do not understand what is happening or why. I have a DataGridView named dgParts. It has multiple columns (with prefix of "dc") associated with it. I used the GUI interface to create it all. At run time the column.Index = 0 for ALL columns. When I use the column name, it works just fine.
Below is a sample of the code from the dgParts_RowEnter Event:
Code:
chkActive.Checked = dgParts.Item(dcActive.Index, e.RowIndex).Value
txtDesc.Text = dgParts.Item(dcDescription.Index, e.RowIndex).Value
cmbDivisionId.SelectedValue = dgParts.Item(dcDivisionId.Index, e.RowIndex).Value
Any suggestions or explanations are welcome. It seems to be intermittent. Not all forms with a DGV have this issue.
--------------------------------------------------
“Crash programs fail because they are based on the theory that, with nine women pregnant, you can get a baby a month.” --Wernher von Braun
--------------------------------------------------