Sorting a Data Gridview
Posted
by Muhammad Waqas
on Stack Overflow
See other posts from Stack Overflow
or by Muhammad Waqas
Published on 2010-03-15T10:25:16Z
Indexed on
2010/03/15
10:29 UTC
Read the original article
Hit count: 318
Hi, I am a beginner to asp.net. I want to sort a gridview but the problem i m facing is when sort event handler is called the exception of stack over flow is thrown. Following is my code for sorting function.
protected void sortGridView(string strSortExpression) { if (strSortExpression != string.Empty) { if (ViewState["sortOrder"] == "desc") { dgvBookInfo.Sort(strSortExpression, SortDirection.Ascending); //string.Format("{0}{1}", ); } else { dgvBookInfo.Sort(strSortExpression, SortDirection.Descending); } } }
Thanks
© Stack Overflow or respective owner