how can i use DataGridViewComboBoxColumn on C# .Net Smart Device Application, .
please review if have any idea's about this area.
Thank's In advance...
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
CrishPosted Dec 3, 2010, 5:43 AM
You can use this below code to solve the issue of DataGridViewComboBoxColum.It will help you.
private void dataGridView1_EditingControlShowing(object sender,
DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex == 0)
{
// Check box column
ComboBox comboBox = e.Control as ComboBox;
comboBox.SelectedIndexChanged += new EventHandler(comboBox_SelectedIndexChanged);
}
}
void comboBox_SelectedIndexChanged(object sender, EventArgs e)
{
int selectedIndex = ((ComboBox)sender).SelectedIndex;
MessageBox.Show("Selected Index = " + selectedIndex);
}
If you want to more detail about code than just go for below link.
http://generally.wordpress.com/2007/12/07/datagridview-get-selectedindex-of-datagridviewcomboboxcolumn/