C#;how to trace DataGridView's click event
-
Hi, Can you please elaborate that exactly what you want to do; because datagridview does have a CellClick Event.
Regards, Ujjaval Modi :) Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.
-
Hi, Can you please elaborate that exactly what you want to do; because datagridview does have a CellClick Event.
Regards, Ujjaval Modi :) Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.
hi i have a datagridview contrl which populates a column from table thru dataset. when i click, or browse through arrow keys , the current cells items should be shown in textboxes for edition.(the selected cell item is key value, i pass it to storedproc and select its other fields to show in textboxes) i had did this through a button click as follows
private void button1_Click(object sender, EventArgs e) { dsGridToTxtBx = obj._selectGridCellAreaDetails(DataGrdVw1.CurrentCell.Value.ToString()); { AreaIdValue = dsGridToTxtBx.Tables[0].Rows[0].ItemArray[0].ToString(); //here retrieved other fields are displayed in two text boxes txtAreaName.Text = dsGridToTxtBx.Tables[0].Rows[0].ItemArray[1].ToString(); //textbox1 txtRegion.Text = dsGridToTxtBx.Tables[0].Rows[0].ItemArray[2].ToString();//textbox2 } }
also i tried like this but this doesnt works? :doh:private void DataGrdVw1_CellClick(object sender, DataGridViewCellEventArgs e) { string CurrentSelValue; CurrentSelValue = DataGrdVw1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); txtAreaName.Text = CurrentSelValue; }
i would thank if anybody gives me solution ksskkssk/div>