I am working with a code snippet from a site
(http://www.gridviewguy.com/ArticleDetails.aspx?articleID=176_Sorting_GridView _Manually!)
as follows:
private void SortGridView(string sortExpression,string direction)
{
// You can cache the DataTable for improving performance
DataTable dt = GetData().Tables[0];
DataView dv = new DataView(dt);
dv.Sort = sortExpression + direction;
GridView1.DataSource = dv;
GridView1.DataBind();
}
But I can't get it to compile (in C#) because it doesn't understand the
GetData() function in the line:
DataTable dt = GetData().Tables[0];
What would I need to include or change to help it understand this line?