I had a data grid with more than 100 rows on it
if the user click the first column of the row the whole row must be selected and if he click on any other column it must not select the whole row
I set the selection mode of datagridview cellselection and made it read only also and tried all the below code but found no use can any one suggest any idea
private void tbljobdata_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (tbljobdata.CurrentCell.ColumnIndex == 0)
{
tbljobdata.Rows[tbljobdata.CurrentCell.RowIndex].Selected = true;
}
}
Handle mouse down event since thats captured the first.
Alter the read only property too accordingly under the condition required.. you can set readonly for individual cells in fact if you want