I am having problems getting paging to work on one of my datagrid controls.
I am developing in Visual Studio.NET and I have tried using both the built
in MyDatagrid_PageIndexChanged event and tried making my own function and
calling it with the onpageindexchanged attribute of the datagrid element.
In either case, it never calls the function and simply reloads the page and
my datagrid vanishes. I am creating the datagrid dynamically by selecting a
table from a dropdown list then selecting what fields I want from a listbox
and hitting a select button. I am stumped. Does anyone have any ideas on
what I might be missing?
Thanks,
Wesley
Ian Oldbury - 08 Apr 2004 20:46 GMT
Hi Wesley
Does you codebehind page have the handles reference?
Private Sub grdPLOFDetail_PageIndexChanged(ByVal source As System.Object,
ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
grdPLOFDetail.PageIndexChanged
And in the aspx file within the datagrid
have
allowpaging="True"
ian
> I am having problems getting paging to work on one of my datagrid controls.
> I am developing in Visual Studio.NET and I have tried using both the built
[quoted text clipped - 8 lines]
> Thanks,
> Wesley
Wesley Robinson - 08 Apr 2004 21:23 GMT
My code behind has the handles reference and allow paging is set to true. I
haven't had a problem setting up paging before, but for some reason in this
instance, when I select a page from the page index, it just calls Page_Load
but doesn't call the _PageIndexChanged function.
Thanks
> Hi Wesley
>
[quoted text clipped - 26 lines]
> > Thanks,
> > Wesley
Wesley Robinson - 13 Apr 2004 19:20 GMT
I think I've narrowed down (or perhaps broadened ) my problem to this, when
AutoGenerateColumns is set to False, I lose my datagrid whenever the page
executes a postback. When AutoGenerateColumns is set to True, I don't have
any problems but I need to be able to set AutoGenerateColumns = False.
> I am having problems getting paging to work on one of my datagrid controls.
> I am developing in Visual Studio.NET and I have tried using both the built
[quoted text clipped - 8 lines]
> Thanks,
> Wesley