Professional Web Applications Themes

Image Button in Datagrid WebControl - ASP.NET Data Grid Control

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" <jim_mitchellmindspring.com> wrote in message news:OVW6B4LUDHA.940TK2MSFTNGP11.phx.gbl... > 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 > >...

  1. #1

    Default Re: Image Button in Datagrid WebControl

    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" <jim_mitchellmindspring.com> wrote in message
    news:OVW6B4LUDHA.940TK2MSFTNGP11.phx.gbl...
    > 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 Guest

  2. #2

    Default Re: Image Button in Datagrid WebControl

    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" <jim_mitchellmindspring.com> wrote in message
    news:eN9b7PNUDHA.1556TK2MSFTNGP10.phx.gbl...
    > 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_nothotmail_no_spamhotmail.com > wrote in
    > message news:O56HADNUDHA.3712tk2msftngp13.phx.gbl...
    > > 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" <jim_mitchellmindspring.com> wrote in message
    > > news:OVW6B4LUDHA.940TK2MSFTNGP11.phx.gbl...
    > > > 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 Guest

  3. #3

    Default Re: Image Button in Datagrid WebControl

    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:
    [url]http://aspnet.4guysfromrolla.com/articles/061002-1.aspx[/url]

    --

    Jos Branders


    Jos Guest

  4. #4

    Default Re: Image Button in Datagrid WebControl

    Thanks, that was a nice link.


    "Jos" <josnospambrandersfastmail.fm> wrote in message
    news:OL1c3w1UDHA.2508TK2MSFTNGP12.phx.gbl...
    > 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:
    > [url]http://aspnet.4guysfromrolla.com/articles/061002-1.aspx[/url]
    >
    > --
    >
    > Jos Branders
    >
    >

    Jim Mitchell Guest

  5. #5

    Default Re: Image Button in Datagrid WebControl

    You can put an <IMG> tag in the Text property as well.

    Justin

    "Jim Mitchell" <jim_mitchellmindspring.com> wrote in message
    news:O#NSg$#UDHA.424TK2MSFTNGP11.phx.gbl...
    > Thanks, that was a nice link.
    >
    >
    > "Jos" <josnospambrandersfastmail.fm> wrote in message
    > news:OL1c3w1UDHA.2508TK2MSFTNGP12.phx.gbl...
    > > 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:
    > > [url]http://aspnet.4guysfromrolla.com/articles/061002-1.aspx[/url]
    > >
    > > --
    > >
    > > Jos Branders
    > >
    > >
    >
    >

    Justin Dutoit Guest

  6. #6

    Default Re: Image Button in Datagrid WebControl

    You could put it into Template Column.

    Hrvoje


    "Jim Mitchell" <jim_mitchellmindspring.com> wrote in message
    news:OVW6B4LUDHA.940TK2MSFTNGP11.phx.gbl...
    > 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 Guest

  7. #7

    Default Image Button in Datagrid WebControl

    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 Guest

  8. #8

    Default Re: Image Button in Datagrid WebControl

    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_nothotmail_no_spamhotmail.com > wrote in
    message news:O56HADNUDHA.3712tk2msftngp13.phx.gbl...
    > 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" <jim_mitchellmindspring.com> wrote in message
    > news:OVW6B4LUDHA.940TK2MSFTNGP11.phx.gbl...
    > > 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 Guest

Similar Threads

  1. Binding a image button to a datagrid
    By herman in forum ASP.NET Data Grid Control
    Replies: 3
    Last Post: October 8th, 09:05 AM
  2. Replies: 2
    Last Post: April 29th, 05:16 PM
  3. DataGrid Cell with Image Button In It
    By KJ in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: December 16th, 02:55 PM
  4. Adding image button to a datagrid in execution time
    By Andrés Giraldo in forum ASP.NET Building Controls
    Replies: 0
    Last Post: September 18th, 05:12 PM
  5. Replies: 1
    Last Post: July 20th, 05:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139