Link to home
Start Free TrialLog in
Avatar of ukerandi
ukerandiFlag for United Kingdom of Great Britain and Northern Ireland

asked on

C# - Winform

Hi See below my code
  private void dataGridViewFranceCube_CellContentClick(object sender, DataGridViewCellEventArgs e)
                DataGridViewRow rowNumber = dataGridViewFranceCube.SelectedRows[0];
                txtitem.Text = rowNumber.Cells[0].Value.ToString();
                txtProductDescription.Text = rowNumber.Cells[2].Value.ToString();

Open in new window

Sometime this is not working, any idea where im doing mistake, What i need is ,when user click i need to get row data for example
if user click on row 2 i need column1 and column 2 data.
Avatar of Naitik Gamit
Naitik Gamit
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ukerandi


private void dataGridViewFranceCube_CellClick(object sender,  DataGridViewCellEventArgs e)


                DataGridViewImageCell cell = (DataGridViewImageCell)



and also i have add following code to Designer.cs also but still not working

   this.dataGridViewFranceCube_CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewFranceCube_CellClick);
do you have any exception thrown ? if yes can you show it ?