Image Button in Datagrid WebControl

Discussion in 'ASP .Net Datagrid Control' started by Alvin Bruney, Jul 23, 2003.

  1. Alvin Bruney

    Alvin Bruney Guest

    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.

    "Jim Mitchell" <> wrote in message
    news:...
    > 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
    >
    >
     
    Alvin Bruney, Jul 23, 2003
    #1
    1. Advertising

  2. Alvin Bruney

    Alvin Bruney Guest

    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;

    "Jim Mitchell" <> wrote in message
    news:...
    > 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
    >
    > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    > message news:...
    > > 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.
    > >
    > > "Jim Mitchell" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alvin Bruney, Jul 23, 2003
    #2
    1. Advertising

  3. Alvin Bruney

    Jos Guest

    Jim Mitchell wrote:
    > 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?


    Use a TemplateColumn. Look here:
    http://aspnet.4guysfromrolla.com/articles/061002-1.aspx

    --

    Jos Branders
     
    Jos, Jul 26, 2003
    #3
  4. Alvin Bruney

    Jim Mitchell Guest

    Thanks, that was a nice link.


    "Jos" <> wrote in message
    news:...
    > Jim Mitchell wrote:
    > > 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?

    >
    > Use a TemplateColumn. Look here:
    > http://aspnet.4guysfromrolla.com/articles/061002-1.aspx
    >
    > --
    >
    > Jos Branders
    >
    >
     
    Jim Mitchell, Jul 27, 2003
    #4
  5. You can put an <IMG> tag in the Text property as well.

    Justin

    "Jim Mitchell" <> wrote in message
    news:O#NSg$#...
    > Thanks, that was a nice link.
    >
    >
    > "Jos" <> wrote in message
    > news:...
    > > Jim Mitchell wrote:
    > > > 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?

    > >
    > > Use a TemplateColumn. Look here:
    > > http://aspnet.4guysfromrolla.com/articles/061002-1.aspx
    > >
    > > --
    > >
    > > Jos Branders
    > >
    > >

    >
    >
     
    Justin Dutoit, Jul 28, 2003
    #5
  6. You could put it into Template Column.

    Hrvoje


    "Jim Mitchell" <> wrote in message
    news:...
    > 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
    >
    >
     
    Hrvoje Vrbanc, Aug 11, 2003
    #6
  7. Alvin Bruney

    Jim Mitchell Guest

    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
     
    Jim Mitchell, Aug 23, 2003
    #7
  8. Alvin Bruney

    Jim Mitchell Guest

    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

    "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    message news:...
    > 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.
    >
    > "Jim Mitchell" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
     
    Jim Mitchell, Aug 23, 2003
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wes Weems
    Replies:
    1
    Views:
    505
    Natty Gur
    Jul 20, 2003
  2. Guest
    Replies:
    2
    Views:
    756
  3. Replies:
    0
    Views:
    508
  4. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    221
    Luis Ramírez
    Jul 6, 2004
  5. Jim Mitchell
    Replies:
    0
    Views:
    226
    Jim Mitchell
    Jul 12, 2003
Loading...

Share This Page