Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
9 Nov 2012Gautam Raithatha
u can check for Header row in CellClick event and dont process for header row. Header row has index -1. so try this:private void gv_CellClick(object sender, DataGridViewCellEventArgs e){ if (e.RowIndex != -1) { //Your code }}
I changed code to thisdg.CurrentRow.Selected = true;now it works, but still its on CellClick event, maybe something different has to be done if it should not be on CellClick event
9 Nov 2012Karthikeyan Mathiyalagan
Hi, Cell click event is not good, you try to use Gridview RowCommand event is to be better
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.