Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid Delete

Status
Not open for further replies.

HotBob

Programmer
May 26, 2006
37
GB
I have a datagrid with 4 template columns. On the last column I have a imagebutton which has a cross on the image, this button is going to be used for delete.

The problem I'm having is that I can not access this button in any way. I am using vb all I am trying to do is to delete the record.

Any ideas?
 
I think what you need to do is use a ButtonColumn, set your Delete Commands, and then make the Button Text an <img> tag to your graphic of the cross. Then of course set up your onDelete function name, Command Name, and then write your delete code.

Is this what you're looking for?
 
i got this to work...

Code:
<asp:DataGrid id=myDG runat=server [b]onDeleteCommand=deleteMe[/b]>
<columns>
<asp:TemplateColumn>
	<ItemTemplate>
		<asp:ImageButton ID=myIBtn runat=server CommandName=Delete ImageUrl="yeah.gif" />
	</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:DataGrid>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top