473,405 Members | 2,444 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,405 software developers and data experts.

Custom ImageButtons in a GridView

1
Hi!

I Have a gridView with a TemplateField, with this code:

Expand|Select|Wrap|Line Numbers
  1. <asp:TemplateField>
  2.   <ItemTemplate>
  3.     <img alt="Editar" src="./imagens/icon_editar.gif" />
  4.     <%# getActionStatus((int)Eval("idacesso"), (bool)Eval("bloqueado")) %>
  5.   </ItemTemplate>
  6.   <HeaderStyle Width="40px" />
  7. </asp:TemplateField>
  8.  
Here is my getActionStatus:

Expand|Select|Wrap|Line Numbers
  1.     protected string getActionStatus(int idAcesso, bool bloqueado)
  2.     {
  3.         if (bloqueado == false)
  4.         {
  5.             return "<img alt=\"Bloquear\" src=\"../admin/imagens/icon_bloquear.gif\" />";
  6.         }
  7.         else
  8.         {
  9.             return "<img alt=\"Ativar\" src=\"../admin/imagens/icon_ativar.gif\" />";
  10.  
  11.         }
  12.     }
  13.  
The Result is:



I need transform this images in asp:ImageButtons, but this approuch don't works when i return ASP.NET Controls like:

Expand|Select|Wrap|Line Numbers
  1. <asp:ImageButton ID="ImageButton1" CssClass="alignBtnImage" Runat="server" ImageUrl="./imagens/icon_bloquear.gif" OnClientClick="return confirm('Deseja realmente bloquear este acesso?');" ToolTip="Bloquear" CommandName="setStatus" />
  2.  
Anyone can help me?
May 29 '07 #1
0 847

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

Similar topics

0
by: Khuzema | last post by:
Dear All, I am using issue tracker architecture and developed business object for my application. Now, in VS Beta 2, I humbly want to know how i can have same feature as dataset, in my business...
8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
1
by: WebMatrix | last post by:
Hi, I started a new web application which so far has several grdiviews displaying data. I find myself reimplementing the same logic (copy/pasting really) in grid's event ItemDataBound and...
2
by: Greg | last post by:
Hello, I am trying to bind a GridView to a custom object I have created. First, here is what I'm trying to do: I have a wizard for adding/editing Users. When the wizard begins, a User...
1
by: Mark Olbert | last post by:
Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So far I've spent going on two days trying to get the following...
7
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla,...
1
by: SachinSachin | last post by:
Hi All, I am implementing a custom gridview control, that emits some javascript to blink a row whenever a new row is added in gridview. The gridview is inside the <asp:updatepanel> for...
0
by: maz77 | last post by:
I've created a custom GridView inside my GridVieBase.cs class: namespace CustomControls{ public class GridViewBase : GridView {...} } and then set the WebConfig as follows: <controls>
0
by: =?Utf-8?B?QVZM?= | last post by:
Hi, I've a requirement in which I want to use the custom sorting.. I mean I've a dropdown with sortable column names and when the user selects the particular column from dropdown , I need to sort...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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,...
0
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...

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.