Databind on Linkbutton within GridView

Discussion in '.NET' started by frenika, Mar 30, 2009.

  1. frenika

    frenika

    Joined:
    Mar 30, 2009
    Messages:
    2
    Within my gridview, I have a linkbutton...

    <asp:LinkButton ID="lbDate" runat="server" Text="<%# Eval( "Name")%>" CommandName="View" CommandArgument="<%# Container.DataItemIndex %>" />

    The Command Argument holds my DataKeyValue which in this case is the 'Event ID'. I know that when the text field is left blank, the command arguement is displayed as the text. However, I don't want the linkbutton to display the Event ID. Instead, there is a date associated with each Event ID. I would like that date to appear as the text of the link button.

    How can this be accomplished? The Eval command in the above Text field gives an error..

    Thanks..
    frenika, Mar 30, 2009
    #1
    1. Advertising

  2. frenika

    frenika

    Joined:
    Mar 30, 2009
    Messages:
    2
    Nevermind..

    I figured it out.. I just munipulated the text value using RowDataBound..
    frenika, Mar 30, 2009
    #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. Nikhil Patel

    databind a grid with linkbutton

    Nikhil Patel, Oct 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    450
    Nikhil Patel
    Oct 18, 2004
  2. Sathyaish
    Replies:
    3
    Views:
    3,082
    Sathyaish
    Sep 8, 2005
  3. CJM
    Replies:
    2
    Views:
    1,226
  4. Michael
    Replies:
    0
    Views:
    214
    Michael
    Dec 29, 2003
  5. CJM

    Responding to LinkButton within a Gridview

    CJM, Jul 6, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    304
Loading...

Share This Page