taktaz_m2600
New Member
I've got some custom header text that's being added on the 'RowCreated' event of my gridview:\[code\]protected void gvResults_RowCreated(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.Header) { LinkButton lbAptNo = new LinkButton(); lbAptNo.Text = "Apartment #"; lbAptNo.Click += new EventHandler(lbAptNo_Click); e.Row.Cells[0].Controls.Add(lbAptNo); }}protected void lbAptNo_Click(object sender, EventArgs e){ gvResults.Sort("aptno", SortDirection.Descending); }\[/code\]This code works fine in the sense that it adds the link button to the gridview and allows me to sort the data in descending order. However what I'm trying to do is detect what the current sorting is for that column, and then sort asc/desc depending on what the current value is.I understand I can use GridView.SortDirection to get the direction of a column but there's no way for me to specify which column. How do I do this? Is there a way I can determine the sort direction of a particular column?Thanks