B
Burak Gunay
Hello,
I have a datagrid on my aspx page without any column definitions.
<asp:datagrid id="dtgValues" style="Z-INDEX: 101; LEFT: 2px; POSITION:
relative" Runat="server" PageSize="10" AutoGenerateColumns="False">
I create the columns and the data dynamically in the code behind
depending on which table the user selected.
When I postback the page, I load the grid again.
If you just use regular paging, and bind the whole dataset to the
datagrid, then paging works.
But when i try to use custom paging i run into problems.
on postback page_load, I load the data again by calling FillGrid()
function
, but then when the PageIndexChanged event gets executed,
Private Sub dtgValues_PageIndexChanged( source , e )
' Set the CurrentPageIndex before binding the grid
dtgValues.CurrentPageIndex = e.NewPageIndex
FillGrid()
End Sub
I end up with two datagrids next to each other.
Is there a way around this?
How can I save the datagrid in viewstate and load it again on the
postback?
Thanks,
Burak
I have a datagrid on my aspx page without any column definitions.
<asp:datagrid id="dtgValues" style="Z-INDEX: 101; LEFT: 2px; POSITION:
relative" Runat="server" PageSize="10" AutoGenerateColumns="False">
I create the columns and the data dynamically in the code behind
depending on which table the user selected.
When I postback the page, I load the grid again.
If you just use regular paging, and bind the whole dataset to the
datagrid, then paging works.
But when i try to use custom paging i run into problems.
on postback page_load, I load the data again by calling FillGrid()
function
, but then when the PageIndexChanged event gets executed,
Private Sub dtgValues_PageIndexChanged( source , e )
' Set the CurrentPageIndex before binding the grid
dtgValues.CurrentPageIndex = e.NewPageIndex
FillGrid()
End Sub
I end up with two datagrids next to each other.
Is there a way around this?
How can I save the datagrid in viewstate and load it again on the
postback?
Thanks,
Burak