Click here to Skip to main content
15,889,651 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please Tell Me the Problm in This It is Not Working Properly
Please Send Me the Solution on my Email

heeramidha@gmail.com

private void combox_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox combox1 = (ComboBox)sender;
if (combox1.SelectedValue != null)
Grid.CurrentRow.Cells[1].Value = combox1.SelectedValue.ToString();
//MessageBox.Show(combox.SelectedValue.ToString());
}
private void combox1_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox combox = (ComboBox)sender;
if (combox.SelectedValue != null)
Grid.CurrentRow.Cells[3].Value = combox.SelectedValue.ToString();
//MessageBox.Show(combox.SelectedValue.ToString());
}

private void Grid_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
switch (Grid.CurrentCell.ColumnIndex)
{

case 0:
{
ComboBox cmb2;
cmb2 = e.Control as ComboBox;
if (cmb2 == null)
{
return;
}
else
{
cmb2.SelectedIndexChanged += combox_SelectedIndexChanged;
}
}
break;
case 2:
{
ComboBox cmb1;
cmb1 = e.Control as ComboBox;
if (cmb1 == null)
{
return;
}
else
{
cmb1.SelectedIndexChanged += combox1_SelectedIndexChanged;
}
}
//MessageBox.Show(Grid.CurrentCell.ColumnIndex.ToString());
break;

}

}
Posted
Comments
Dinesh.V.Kumar 26-Feb-14 1:16am    
What is the problem you are facing??? Kindly provide the error information and also rephrase the question so that we can help you.

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