Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > ButtonColumn as Image?

Reply
Thread Tools

ButtonColumn as Image?

 
 
TheDude5B
Guest
Posts: n/a
 
      03-02-2006
I am using a ButtonColumn which is used to delete an item from the
datagrid.

Is it possible to use an image instead of just text for this
ButtonControl?


If this is not possible, then how would i change the code for this
ButtonControl to work with an ASP reapeater instead.

for example just now i have the buttoncontrol linked to the procedure

Sub Delete_Item (Sender As Object, E As DataGridCommandEventArgs)

objDT = Session("cart")
objDT.Rows(e.Item.ItemIndex).Delete()
Session("cart") = objDT

End Sub


but if using an asp repeater

i am wanting to use this code

<a href='<%#
Databinder.Eval(Container.DataItem,"ItemName","del ete.aspx&id={0}" )
%>'><img src="images/x.gif" border="0" alt="Remove Item" />

to be used to delete the selected item. However as u will notice, the
code on the ASP repeater line will open up the page delete.aspx, I do
not want to do this and just be able to use code on the same page to
delete the selected row.

All Help is welcome.

Thanks

 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      03-02-2006
Yes something like

<asp:ButtonColumn Text="<IMG src='~/Images/myImage.gif'; border='0'>"
CommandName="delete"></asp:ButtonColumn>

HTH

"TheDude5B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I am using a ButtonColumn which is used to delete an item from the
> datagrid.
>
> Is it possible to use an image instead of just text for this
> ButtonControl?
>
>
> If this is not possible, then how would i change the code for this
> ButtonControl to work with an ASP reapeater instead.
>
> for example just now i have the buttoncontrol linked to the procedure
>
> Sub Delete_Item (Sender As Object, E As DataGridCommandEventArgs)
>
> objDT = Session("cart")
> objDT.Rows(e.Item.ItemIndex).Delete()
> Session("cart") = objDT
>
> End Sub
>
>
> but if using an asp repeater
>
> i am wanting to use this code
>
> <a href='<%#
> Databinder.Eval(Container.DataItem,"ItemName","del ete.aspx&id={0}" )
> %>'><img src="images/x.gif" border="0" alt="Remove Item" />
>
> to be used to delete the selected item. However as u will notice, the
> code on the ASP repeater line will open up the page delete.aspx, I do
> not want to do this and just be able to use code on the same page to
> delete the selected row.
>
> All Help is welcome.
>
> Thanks
>



 
Reply With Quote
 
 
 
 
TheDude5B
Guest
Posts: n/a
 
      03-03-2006
Thats worked great thanks!

Pat on the back for you my good friend!!

 
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
ButtonColumn postback problem =?Utf-8?B?Sm9obiBNY0RvbmFnaA==?= ASP .Net 0 03-06-2004 03:56 AM
ButtonColumn Roger ASP .Net 1 01-23-2004 03:54 AM
DataGrid ButtonColumn/BoundColumn problem John ASP .Net 3 11-03-2003 02:20 PM
Enabling/Disabling a DataGrid ButtonColumn CGuy ASP .Net 2 10-22-2003 05:43 PM
How to use ButtonColumn to select a Datagrid row? Northern ASP .Net 0 07-22-2003 08:34 PM



Advertisments