Hi,
It seems that if a DataGrid has EnableViewState="false" then the OnPageIndexChanged, OnSortCommand etc no longer fire (I'm using C# with codebehind) ?
However a search on the web shows a few VB examples where this seems ok (I can't find any for C#).
I would like EnableViewState="false" as it almost halves the page size and anyway the grid is rebound each round-trip. Does anyone know if this is/isn't possible, and why ?
(snippet from aspx)
<asp:datagrid
id="TaskGrid"
runat="server"
EnableViewState="false"
OnPageIndexChanged="TGrid_PageIndexChanged"
AllowPaging="True"
PageSize="15" > etc...
(snippet from codebehind)
protected void TGrid_PageIndexChanged(
object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
ViewState["SearchPageIndex"] = e.NewPageIndex;
DoSearch();
}
Thanks, Seb.