|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DATAGRID EVENT HANDLERS - NOT FIRING?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 Frank.Wa***@gmail.com Your grid's event handler doesn't seem to have a "Handles
DataGrid1.PageIndex Changed" clause at the end. Show quoteHide quote "Frank Walsh" <Frank.Wa***@gmail.com> wrote in message news:uoDWfHoUFHA.3620@TK2MSFTNGP09.phx.gbl... > 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 > > Frank.Wa***@gmail.com > > >
DataGrids, SortCommands and Microsoft IE WebControl TabStrips Problem
ASP.NET - How to bind() a dataset to a datagrid using javascript from the client Pop-up Message Box binding ArrayLists to DataGrids-- how to name the columns? Newbie: Datagrid Comes Up Blank?!? Subclassing a DataGrid control How Do I Conditionally Remove An EditCommandColumn? trying to display header only HOWTO: Bring that row back into focus ... Two questions: datagrid with string[] and how to differentiate between columns |
|||||||||||||||||||||||