F
Frank Walsh
My question is regarding Datagrid's and some trouble I am experiencing
getting events to fire. Here goes:
My Page_Load Looks like this:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
BindData()
End If
End Sub
My Pager Handler looks like this:
Sub PageIndexChanged_Click(ByVal sender As Object, ByVal e As
DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
BindData()
End Sub
My ASPX FILE DATAGRID DEF. LOOKS LIKE THIS
asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 16px; POSITION:
absolute; TOP: 256px"
runat="server" OnPageIndexChanged="PageIndexChanged_Click"
AllowPaging="True" PageSize="25"
AllowSorting="True"></asp:datagrid
So I would expect this code to fire the pager handler when i click a number
based on all the examples I've found. It however does not. Now I can get the
event to fire by removing the Not Ispostback clause. However, this ends up
calling my bindata function twice, once in page_load and once in the
handler. I have viewstate enabled on page, what am i missing?
Thank You
(e-mail address removed)
getting events to fire. Here goes:
My Page_Load Looks like this:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
BindData()
End If
End Sub
My Pager Handler looks like this:
Sub PageIndexChanged_Click(ByVal sender As Object, ByVal e As
DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
BindData()
End Sub
My ASPX FILE DATAGRID DEF. LOOKS LIKE THIS
asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 16px; POSITION:
absolute; TOP: 256px"
runat="server" OnPageIndexChanged="PageIndexChanged_Click"
AllowPaging="True" PageSize="25"
AllowSorting="True"></asp:datagrid
So I would expect this code to fire the pager handler when i click a number
based on all the examples I've found. It however does not. Now I can get the
event to fire by removing the Not Ispostback clause. However, this ends up
calling my bindata function twice, once in page_load and once in the
handler. I have viewstate enabled on page, what am i missing?
Thank You
(e-mail address removed)