Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get the gridview cell control in windows form application using row and column index. controls means combox in gridviw cell

I can get it from EditingControlShowing event in there using (ComboBox)e.Control;

My question is how to get it using row and column index
Posted

1 solution

I think it will be EditingControlShowing event in datagridview.

Try this

private void DGV_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
    {
    comboBOX = (ComboBox)e.Control;
    comboBOX .SelectedIndexChanged -=new EventHandler(comboBOX _SelectedIndexChanged);
    comboBOX .SelectedIndexChanged +=new EventHandler(comboBOX _SelectedIndexChanged);
    }
    private void comboBOX _SelectedIndexChanged(object sender, EventArgs e)
    {
    ComboBox combo = sender as ComboBox;
    string str=combo.SelectedIndex.ToString();
    }
 
Share this answer
 
v2
Comments
Arun Kumar K S 27-Apr-12 6:22am    
thaks to your reply, But i know to take control using EditingControlShowing event my problem is to get the editingcontrol without using EditingControlShowing event. In my mono developer EditingControlShowing event is not working I am serching for an alternate method without using EditingControlShowing event

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