I am using Telerik gridview in a winform application. When I click on the row the control goes to another page with some data. I am using grid views click event to pass the control to another form. But even when you click on header column or pager row it is going to the next form with data selected from the first row. What is the way to figure out the type of row. Whether it is a datarow or a header row?
private void grdGuests_Click(object sender, EventArgs e)
{
int id = Convert.ToInt32(this.grdGuests.CurrentRow.Cells[1].Value.ToString());
GuestDetails gd = new GuestDetails(id);
gd.Show();
}
I even tried to use MouseClick but its the same thing if I click on next page button or header row it takes it as a grid click event and pass the control to next page.
You can use the CurrentRowChanged event and check if the row type is GridViewDataRow info, so you avoid non-data rows.