Image Button in Datagrid WebControl

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  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_mitchell@mindspring.com> wrote in message
    news:OVW6B4LUDHA.940@TK2MSFTNGP11.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. Similar Questions and Discussions

    1. Binding a image button to a datagrid
      Hi: I have a datagrid and I've created a itemtemplate column with textbox inside each row like the following: <asp:TemplateColumn...
    2. Changing ImageURL of Image Button which is added in template column of datagrid
      hello, I have a template column in my datagrid. To the header of template colum, i have added imagebutton. On click of the imagebutton , i...
    3. DataGrid Cell with Image Button In It
      I create a datagrid and at runtime I add an ImageButton to certain cells(e.Item.Cells.Controls.Add(imgbutton)). Now when I click on a row that...
    4. Adding image button to a datagrid in execution time
      Hi! Somebody could give a sample of how can I add an image button to a datagrid in execution time? Thanks! *** Sent via Developersdex...
    5. JavaScript Access to Button in form tags (webcontrol or html button)
      Hello, I have a button called LoadBtn, which exists in <form name="Form1" runat=server></form> tags. I then have javascript loaded outside of...
  3. #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_mitchell@mindspring.com> wrote in message
    news:eN9b7PNUDHA.1556@TK2MSFTNGP10.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_not@hotmail_no_spamhotmail.com > wrote in
    > message news:O56HADNUDHA.3712@tk2msftngp13.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_mitchell@mindspring.com> wrote in message
    > > news:OVW6B4LUDHA.940@TK2MSFTNGP11.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

  4. #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

  5. #4

    Default Re: Image Button in Datagrid WebControl

    Thanks, that was a nice link.


    "Jos" <josnospambranders@fastmail.fm> wrote in message
    news:OL1c3w1UDHA.2508@TK2MSFTNGP12.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

  6. #5

    Default Re: Image Button in Datagrid WebControl

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

    Justin

    "Jim Mitchell" <jim_mitchell@mindspring.com> wrote in message
    news:O#NSg$#UDHA.424@TK2MSFTNGP11.phx.gbl...
    > Thanks, that was a nice link.
    >
    >
    > "Jos" <josnospambranders@fastmail.fm> wrote in message
    > news:OL1c3w1UDHA.2508@TK2MSFTNGP12.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

  7. #6

    Default Re: Image Button in Datagrid WebControl

    You could put it into Template Column.

    Hrvoje


    "Jim Mitchell" <jim_mitchell@mindspring.com> wrote in message
    news:OVW6B4LUDHA.940@TK2MSFTNGP11.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

  8. #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

  9. #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_not@hotmail_no_spamhotmail.com > wrote in
    message news:O56HADNUDHA.3712@tk2msftngp13.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_mitchell@mindspring.com> wrote in message
    > news:OVW6B4LUDHA.940@TK2MSFTNGP11.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

Posting Permissions

  • You may not post new threads
  • You may 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