Image Button in Datagrid WebControl

A

Alvin Bruney

in your itemdatabound or itemcreated event handler just add a label control
or any control that will take a url tag to the cell. then add the image to
the newly inserted control.
 
A

Alvin Bruney

sure you can put anything in there, even a jet plane...
this is for a hyperlink, substitute for your own user control.
//add a hyperlink for bogus results

HyperLink tb = new HyperLink();

tb.ForeColor = Color.Blue;

tb.Text = "Invalid";

tb.Font.Size = FontUnit.XXSmall;

tb.NavigateUrl = "Invalid.aspx";

e.Item.Controls[e.Item.Cells.Count - 1].Controls.Add(tb);

tb = null;
 
J

Jim Mitchell

Is there any way to put in image button in the datagrid. The button column
seems to have all the functionality, but does not have an img_url property.

Thanks in advance.

Jim
 
J

Jim Mitchell

I guess I did not know that you can just put controls (like the image
control) into a cell on the datagrid. If you have a minute, can you let me
know how you would do that?

Thanks,

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top