473,513 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

button header on gridview not fired event

4 New Member
I have a gridview that autogeneratecolumns is true.I want to adding button to gridview's header .The problem is button not fired event.
My code :

Expand|Select|Wrap|Line Numbers
  1.  
  2. Protected Sub grdPoint_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdPoint.RowDataBound
  3.  
  4. If e.Row.RowType = DataControlRowType.Header Then
  5. For i As Integer = 9 To 20
  6. Dim btn As New Button
  7. AddHandler btn.Click, AddressOf click
  8. btn.ID = i
  9. btn.Text = e.Row.Cells(i).Text
  10. btn.EnableViewState = True
  11. btn.CausesValidation = False
  12. e.Row.Cells(i).Controls.Add(btn)
  13. Next
  14. End If
  15.  
  16. End Sub
  17.  
  18. Public Sub click(ByVal sender As Object, ByVal e As System.EventArgs)
  19.  
  20. 'do something
  21.  
  22. End Sub
  23.  
Please help....
Jul 2 '08 #1
0 733

Sign in to post your reply or Sign up for a free account.

Similar topics

2
11100
by: Arjen | last post by:
Hi, I get this error message when sorting a gridview: The GridView 'GridView1' fired event Sorting which wasn't handled What do I need to do? Thanks!
4
3494
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
9
11816
by: J055 | last post by:
Hi I'm trying to get an instance of UserLists to persist after it's been used by the GridView. I understand from the documentation that The OnObjectCreated event allows access to the instance. I...
3
3257
by: NH | last post by:
I have this peice of code in my gridview <HeaderTemplate> <asp:ImageButton ID="btnPrevious" ImageUrl="~/Images/Calendar/ico_Previous.png" runat="server" /> <asp:ImageButton ID="btnNext"...
0
1592
by: Giovanni | last post by:
I was wondering if someone would be able to help me with the following: Simply put, I have built an ASP.NET 2.0 WebUserControl (UC1). UC1 contains: A GridView which is bound to an SQLDataSource...
0
4098
by: googleThis | last post by:
I have a GridView control on a ASP.NET 2.0 page. I load the GridView with a SqlDataReader that gets its data from a stored procedure. Here is how the grid is defined: <asp:GridView...
5
32145
by: bbawa1 | last post by:
Hi, I have a button field in GridView. It shows the ID. When I click on it should grab the id and open new ASpx page based on that ID. How can I do that. Thanks in advance
5
1957
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I have a sub in vb.net that adds extra headers to a gridview and it works very well. however, i tried to translate it to c# and i'm getting the header inserting itself over the first datarows and...
2
10835
by: shapper | last post by:
Hello, I am working with a ListView but I suppose that with a GridView might be the same. Instead of having an Insert Button on each GridView row I would like to have only one Insert button,...
0
7264
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7543
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7106
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5094
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.