views:

65

answers:

1

Hi

i have created a datagridview that is populated with data from the database. When i am displaying the data in my application I add two datagridviewcomboboxcolumns which contain a list of selectable values. These display correctly in the application. The idea is that a user selects a value then hits a button that will take the value and update the database. The problem is that when the update button is pressed the two added datagridviewcolumns are not returned as part of the datagridview, instead when i try to reference the columns in my c# code only the original columns are available.

Please can someone advise as to how I can retrieve the datagridview with the new columns?

Many thanks,

Stu

A: 

Issue solved! I was declaring the ComboboxColumn both globally then locally when i was adding it to the datagridview! by removing the local reference and only using global i was able to retrieve the value at a later stage using

ComboboxColumn.DataGridView.Rows[x].Cells[0].Value.ToString();

Stu