C# Datagridview: Combobox Column cell value is null even after user selects item?

I am not sure However I think you will find that the datarows have been created using the old column definitions. When you add a new column I doubt it is resizing the arrays for each row to add a column. Although if this was true I would expect an index out of range exceptions.

You need to break that big line of code up so so that it is easier to debug. IE when you leave the loop does the cell have the value you expect? Or has the assign failed?

It will tell you where things are going wrong. If it is assigning then you lose the data later then you need to expand your search (this could happen if you have somehow assumed a value type was a reference type for instance) you may finid you need to create a new data table with the correct column definitions and then copy the old data into the new one ... but first you need to establish where it is failing - you are currently doing too much in 1 line of code. Are you sure the value syou are getting from the combo box are not null?

Sorry for the tardy reply, but yes I did debug and all I get is a "object reference not set to an instance" exception when I get to that line where I "do a lot of things. " I think the new datatable idea seems very plausible, I'll try it out when I get a chance. =) – tf.

Rz Jun 1 at 22:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions