I have the following function to populate a grid. The select info returns a DataTable with the data. Everything works fine until I try to sort. I click the first time and the sort works fine. If I click the column again, nothing happens. I have the NeedDataSource event enabled, with the following code (rgData.MasterTableView.DataSource= SelectInfo();) Looks like the grid is keeping a cache of the data, because the function returns the data sorted correctly, but the grid keeps the display wrong
Bind data function
function InitGrid()
{
rgData.MasterTableView.DataSource= SelectInfo();
rgData.DataBind();
}
Sort Event
if (!e.Item.OwnerTableView.SortExpressions.ContainsExpression(e.SortExpression))
{
/*controls used for function to define sorting order*/
txtHSortOrder.Value = "A";
txtHSortBy.Value = e.SortExpression;
e.Item.OwnerTableView.SortExpressions.AddSortExpression(e.SortExpression);
}
else
{
txtHSortOrder.Value = "D";
}
Bind data function
function InitGrid()
{
rgData.MasterTableView.DataSource= SelectInfo();
rgData.DataBind();
}
Sort Event
if (!e.Item.OwnerTableView.SortExpressions.ContainsExpression(e.SortExpression))
{
/*controls used for function to define sorting order*/
txtHSortOrder.Value = "A";
txtHSortBy.Value = e.SortExpression;
e.Item.OwnerTableView.SortExpressions.AddSortExpression(e.SortExpression);
}
else
{
txtHSortOrder.Value = "D";
}