Linkbutton.text is empty...

Discussion in 'ASP .Net Datagrid Control' started by JeffP@Work, Sep 12, 2006.

  1. JeffP@Work

    JeffP@Work Guest

    There must be an easier way....

    My link button text value is always empty on ItemCommand

    'gets the current datagrid
    Dim dg as Datagrid = e.Item.NamingContainer

    'aspx has
    <asp:LinkButton id="btnSelectSMFC" CommandName=="SelectCallsSMFC"

    I've tried...

    dim myText = Ctype(e.Item.CommandSource).Text

    For each item as DataGridItem in dgItems

    dim lnkBtn as Linkbutten = item.FindControl("btnSelectCallsSMFC")

    dim lbl as Label = item.FindControl("btnSelectCallsSMFC")

    I do get text values of my <asp:BoundColumn's

    Painfully, but perhaps my only way will be to make not visible shadow
    columns for each linkbutton column.

    TIA

    JeffP.....
     
    JeffP@Work, Sep 12, 2006
    #1
    1. Advertising

  2. JeffP@Work

    JeffP@Work Guest

    My error, <asp:TemplateColumns with a linkButton: although intellisense
    doesn't offer a Text= adding it as Text='<% # DataBinder.Eval(Container,
    "DataItem.FieldName") %>... JeffP....

    "JeffP@Work" <jpgmt_at_sbcglobal_dot_net> wrote in message
    news:e%...
    > There must be an easier way....
    >
    > My link button text value is always empty on ItemCommand
    >
    > 'gets the current datagrid
    > Dim dg as Datagrid = e.Item.NamingContainer
    >
    > 'aspx has
    > <asp:LinkButton id="btnSelectSMFC" CommandName=="SelectCallsSMFC"
    >
    > I've tried...
    >
    > dim myText = Ctype(e.Item.CommandSource).Text
    >
    > For each item as DataGridItem in dgItems
    >
    > dim lnkBtn as Linkbutten = item.FindControl("btnSelectCallsSMFC")
    >
    > dim lbl as Label = item.FindControl("btnSelectCallsSMFC")
    >
    > I do get text values of my <asp:BoundColumn's
    >
    > Painfully, but perhaps my only way will be to make not visible shadow
    > columns for each linkbutton column.
    >
    > TIA
    >
    > JeffP.....
    >
     
    JeffP@Work, Sep 13, 2006
    #2
    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. Sathyaish
    Replies:
    3
    Views:
    3,113
    Sathyaish
    Sep 8, 2005
  2. John

    empty/non-empty element

    John, Jul 15, 2003, in forum: XML
    Replies:
    1
    Views:
    1,035
    Klaus Johannes Rusch
    Jul 16, 2003
  3. Lukas
    Replies:
    3
    Views:
    817
    spiff
    Nov 10, 2005
  4. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    579
    Dave Thompson
    Feb 14, 2004
  5. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    189
    Sathyaish
    Sep 8, 2005
Loading...

Share This Page