473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ImageButton inside of a DataGrid

I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemcommand event when it is clicked. Does anyone have a link to a
tutorial or a solution for this problem?

For my datagrid I do have the OnItemCommand propert set.

<asp: Datagrid id="DataGrid1" runat="server" OnItemCommand="gStarted">

In the code the function is:

public sub gStarted(byval sender as object, byval e as
datagridCommandEventArgs) handles DataGrid1.itemCommand

This is not firing the event.
Feb 14 '06 #1
2 1647
Hi,

first make sure that you are binding the grid in page_load inside "If Not
Page.IsPostBack Then" check. If you aren't (missing the check) it will
rebind the grid, and "eat" up the postback events.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Lagwagon" <La******@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemcommand event when it is clicked. Does anyone have a link to
a
tutorial or a solution for this problem?

For my datagrid I do have the OnItemCommand propert set.

<asp: Datagrid id="DataGrid1" runat="server" OnItemCommand="gStarted">

In the code the function is:

public sub gStarted(byval sender as object, byval e as
datagridCommandEventArgs) handles DataGrid1.itemCommand

This is not firing the event.

Feb 14 '06 #2
That did it. Just started ASP and still getting used to the client/server and
postback things. Thanks a bunch. It threw me off because it was firing
linkbuttons in that same datagrid.

"Teemu Keiski" wrote:
Hi,

first make sure that you are binding the grid in page_load inside "If Not
Page.IsPostBack Then" check. If you aren't (missing the check) it will
rebind the grid, and "eat" up the postback events.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

"Lagwagon" <La******@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemcommand event when it is clicked. Does anyone have a link to
a
tutorial or a solution for this problem?

For my datagrid I do have the OnItemCommand propert set.

<asp: Datagrid id="DataGrid1" runat="server" OnItemCommand="gStarted">

In the code the function is:

public sub gStarted(byval sender as object, byval e as
datagridCommandEventArgs) handles DataGrid1.itemCommand

This is not firing the event.


Feb 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jake | last post by:
Hi All, I have an aspx page with a datagrid which I am using to display a list of thumbnails and their descriptions. The thumbnails are sitting on my harddrive and the links to them are stored...
2
by: Chuck Hartman | last post by:
I've been trying to add an ImageButton object to a Calendar table cell, but so far I am unable to handle the Command event from that button in my form's code behind. Below is an example of what I...
5
by: J McD | last post by:
Hi I have a DataGrid with an ImageButton column. When I click on an imagebutton I get a postback but it doesn't run the OnImgBtnClick method. I can actually comment out the line where I add this...
2
by: CJ Oakwood | last post by:
Morning - I am hoping somebody from this group can help me out here... I have been trying to add an array of ImageButtons to my WebForm however I keep getting an exception that I can't seem to...
2
by: Lars Netzel | last post by:
Hi I had a Delete Column in a datagrid that was a Linkbutton. That needed to change into a ImageButton because of the design demands in the project. Then how do I trigger the DeleteCommand with...
1
by: MattB | last post by:
I have a button column in a datagrid that is the delete button. Right now it is just a text link. When I go into the Property Builder My button choices are only LinkButton or PushButton. I'd like...
3
by: jens.buchta | last post by:
Hi! I'm using a DataGrid with a template column to display an Image inside of it. I'm hooking into its OnPrerender-Event to set the ImageURL-Property dynamically. Everything works just fine...
2
by: DC | last post by:
Hi, why does this not work: <asp:ImageButton id="myButt" runat="server" OnCommand="myButt_kick" ImageUrl="<% =GetMyButtUrl() %>" </asp:ImageButton>
0
by: Erik Lautier | last post by:
Hi, I'm running into a bit of a headache trying to use an imagebutton in my datagrid; if I use a linkbutton in a buttoncolumn, it all works perfectly, but the second I switch to an imagebutton in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.