Click here to Skip to main content
15,895,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
First,i should say i searched a lot but i didnt find my solution

i did these works:

1.

this.dataGridView1[1, 1] = new DataGridViewComboBoxCell();


Got This Error :
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

2.
DataGridViewComboBoxCell dgv_cbcell=new DataGridViewComboBoxCell();
dgv_cbcell.Value = null;
dataGridView1.Rows[e.RowIndex].Cells[2] = dgv_cbcell;
dataGridView1.Rows[e.RowIndex].Cells[2].ValueType = dgv_cbcell.ValueType;

Got This Error :
DataGridViewComboBoxCell value is not valid
Posted

1 solution

Hi there,
use "0" as column index.


Happy Coding :)
 
Share this answer
 
Comments
arashmobileboy 18-May-12 8:34am    
Where do you mean?
Sunny_Kumar_ 18-May-12 10:20am    
I mean this.dataGridView1[0, 1] = new DataGridViewComboBoxCell();

:)
arashmobileboy 18-May-12 10:24am    
again i got error : Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Sunny_Kumar_ 18-May-12 10:28am    
can you plz share the complete code so that may assist you in a better way.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900