Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DATAGRID EVENT HANDLERS - NOT FIRING?

Reply
Thread Tools

DATAGRID EVENT HANDLERS - NOT FIRING?

 
 
Frank Walsh
Guest
Posts: n/a
 
      05-06-2005
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

http://www.velocityreviews.com/forums/(E-Mail Removed)



 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      05-07-2005
Your grid's event handler doesn't seem to have a "Handles
DataGrid1.PageIndex Changed" clause at the end.


"Frank Walsh" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
edit update and canel buttons not firing correct event handlers lauralucas@gmail.com ASP .Net Datagrid Control 2 07-13-2006 03:56 PM
User Control Page Load not firing (nor event handlers) in VS 2005 Dood ASP .Net 1 12-20-2005 10:31 PM
Event handlers called twice, or not at all Andy Baldwin ASP .Net Building Controls 1 10-29-2004 12:49 AM
datagrid event handlers not being called in IIS 6 Edward Bills ASP .Net 0 08-25-2004 07:01 PM
Datagrid Event Handlers Michael Albanese ASP .Net Web Controls 0 06-30-2003 03:16 PM



Advertisments