J
Jim McGivney
I am trying to sort a web datagrid asp.net.
In the sort command I use:
private void MyGrid_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
DataView SortView = anteSet11.Ante.DefaultView;
SortView.Sort = e.SortExpression;
MyGrid.DataSource = SortView;
MyGrid.DataBind();
}
In the page_load I use:
private void Page_Load(object sender, System.EventArgs e)
{
sqlDataAdapter1.Fill(anteSet11);
if (!IsPostBack)
{
MyGrid.DataSource = anteSet11.Ante.DefaultView;
}
MyGrid.DataBind();
}
When I press the header, the computer clicks (makes a
sound) but the column does not sort.
I have allowed sorting on the grid's property page.
Generate-columns-automatically is off. The sort command
for each column is appropriate.
The datagrid works in other tasks such as paging, update,
edit and delete.
Any suggestions would be welcomed.
Thanks,
Jim
In the sort command I use:
private void MyGrid_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
DataView SortView = anteSet11.Ante.DefaultView;
SortView.Sort = e.SortExpression;
MyGrid.DataSource = SortView;
MyGrid.DataBind();
}
In the page_load I use:
private void Page_Load(object sender, System.EventArgs e)
{
sqlDataAdapter1.Fill(anteSet11);
if (!IsPostBack)
{
MyGrid.DataSource = anteSet11.Ante.DefaultView;
}
MyGrid.DataBind();
}
When I press the header, the computer clicks (makes a
sound) but the column does not sort.
I have allowed sorting on the grid's property page.
Generate-columns-automatically is off. The sort command
for each column is appropriate.
The datagrid works in other tasks such as paging, update,
edit and delete.
Any suggestions would be welcomed.
Thanks,
Jim