G
Guest
I have a DataGrid on my ASPX and I'm confused about the interaction with the
page based on whether the page is just loading or is being reloaded with a
call to the SortCommand of the DataGrid:
If I do the SQL query and the DataGrid.DataBind() in the Page_Load(), and
then I do it AGAIN inside the SortCommand function I set up, everyhting works
fine. But that seems inefficient because it means that the
DataGrid.DataBind() gets called twice: once on Page_Load, and then again with
the new sort criteria in the SortCommand function.
But what's weird is that if I take the DataGrid.DataBind() OUT of the
Page_Load, then the SortCommand function never even gets called and I can't
understand why that would be.
page based on whether the page is just loading or is being reloaded with a
call to the SortCommand of the DataGrid:
If I do the SQL query and the DataGrid.DataBind() in the Page_Load(), and
then I do it AGAIN inside the SortCommand function I set up, everyhting works
fine. But that seems inefficient because it means that the
DataGrid.DataBind() gets called twice: once on Page_Load, and then again with
the new sort criteria in the SortCommand function.
But what's weird is that if I take the DataGrid.DataBind() OUT of the
Page_Load, then the SortCommand function never even gets called and I can't
understand why that would be.