473,662 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageButton inside of a DataGrid

I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemco mmand 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
datagridCommand EventArgs) handles DataGrid1.itemC ommand

This is not firing the event.
Feb 14 '06 #1
2 1675
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******@discu ssions.microsof t.com> wrote in message
news:A9******** *************** ***********@mic rosoft.com...
I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemco mmand 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
datagridCommand EventArgs) handles DataGrid1.itemC ommand

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******@discu ssions.microsof t.com> wrote in message
news:A9******** *************** ***********@mic rosoft.com...
I have an Image Button inside of a Datagrid and its not firing the
datagrid.itemco mmand 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
datagridCommand EventArgs) handles DataGrid1.itemC ommand

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
1425
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 in an Access database. I have placed an ImageButton in a template column in the datagrid and as the grid loads the ImageURL property of the ImageButton is filled from the database.
2
3635
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 am trying to do. The ImageButton that is on the form handles its Command event just fine, but the ImageButton that is added to the cell does not handle the event. Am I doing something wrong, or is not possible to add server controls to a calendar...
5
6166
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 Click event to the ImageButton Column and it makes no difference, I still get a postback. This is driving me crazy...something seems to be causing an OnClick postback and it isn't my Click event I've included the code below....any help will be...
2
4004
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 find an answer for any where on the net. Any help in the right direction would be greatly appreciated. If more code/source is need please let me know and I will post more.
2
3237
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 that button? I don't want to have to add a AddHandler in the ItemCreated or ItemDataBound for this ImageButton cause then I can't get the ID from the Row to delete as easy...
1
3407
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 it to be an ImageButton so I tried converting the column to a Template Column. Then I edited the template to change the LinkButton to an ImageButton and replaced the text property with ans ImageURL property. The Datagrid looks how I wanted it...
3
3905
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 here, until I thought "It would be cool, if the user could click on that image..". So I replaced the Image-Control with an ImageButton. My Problem is, that the ImageButton doesn't fire any events. Any other
2
2882
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
920
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 templatecolumn, nothing happens...I don't get an error, it's just that the row is not deleted. Relevant code is below; would really appreciate a helping hand. Thanks. <asp:DataGrid ID="dgCart" AutoGenerateColumns="false"...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5655
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.