A
adriank
I'm trying to make a sortable grid. I get the grid the first time the
page loads, then I click on the column name, and the page reloads with
an empty grid (only headers are shown). Any idea?
This is the code:
private void Page_Load(object sender, System.EventArgs e)
{
if ( !IsPostBack)
{
daEvents.Fill(dsEvents);
dgEvents.DataBind();
}
}
private void dgEvents_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
daEvents.Fill(dsEvents);
dsEvents.eventsTBL.DefaultView.Sort = e.SortExpression;
dgEvents.DataBind();
}
page loads, then I click on the column name, and the page reloads with
an empty grid (only headers are shown). Any idea?
This is the code:
private void Page_Load(object sender, System.EventArgs e)
{
if ( !IsPostBack)
{
daEvents.Fill(dsEvents);
dgEvents.DataBind();
}
}
private void dgEvents_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
daEvents.Fill(dsEvents);
dsEvents.eventsTBL.DefaultView.Sort = e.SortExpression;
dgEvents.DataBind();
}