Hi,
You can disable viewstate for each item in your datagrid.If you disable
viewstate in DataGridItems only,paging and
post back will work.You can do so by disabling view state of datagrid items
in the PreRender event handler.
private void Page_PreRender(object sender,EventArgs e){
foreach(DataGridItem dg in DataGrid1.Items){
dg.EnableViewState=false;
}
}
Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com
"Al Cadalzo" <> wrote in message
news:...
>
> I am having a performance problem with a datagrid control that has a large
> viewstate due to several columns containing very long href's in the
> hyperlinks. I need the enableviewstate = true to enable paging
> (AllowPaging=true,PageSize=50). If I don't enableViewState on the
DataGrid
> then my PageIndex_Changed handler doesn't get executed. I retrieve fresh
> data each time I postback, so I don't actually need the datagrid's items
in
> the viewState, all I need is the page number. Is there a way that I can
> use ViewState just to enable the PageIndex_Changed handler to work,
without
> passing the dataGrid's dataitems in ViewState? Maybe someone has written
> their own code to enabling paging so that the DataGrid's viewstate can be
> turned off?
>
> Thanks,
> Al
>
>