Click here to Skip to main content
15,885,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm beginner to ASP.Net with C# Can anyone guide me to add a dropdown to the cell of gridview when the cell is double clicked at runtime, the cell should not be edittable until it is double clicked
Posted
Updated 24-Jul-11 22:57pm
v2

 
Share this answer
 
Comments
CyborgForever 25-Jul-11 3:19am    
I am not familiar with VB.Net is it possible to find some C# code
First add a CellClick event in Formdesigner for the DataGridView as below:
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); 

Then add following code in your form to get cell address:
<pre lang="cs">private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
       {
            Point p = dataGridView1.CurrentCellAddress;
           MessageBox.Show(p.X.ToString(), p.Y.ToString());    // display row and cell nos.
   }




Hope this will help you.
 
Share this answer
 
Comments
CyborgForever 25-Jul-11 3:19am    
I want find index of cell clicked in gridview ASP.Net control

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