Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Databind on Linkbutton within GridView

Reply
Thread Tools

Databind on Linkbutton within GridView

 
 
frenika frenika is offline
Junior Member
Join Date: Mar 2009
Posts: 2
 
      03-30-2009
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..
 
Reply With Quote
 
 
 
 
frenika frenika is offline
Junior Member
Join Date: Mar 2009
Posts: 2
 
      03-30-2009
Nevermind..

I figured it out.. I just munipulated the text value using RowDataBound..
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Responding to LinkButton within a Gridview CJM ASP .Net 2 07-06-2007 04:01 PM
Responding to LinkButton within a Gridview CJM ASP .Net Web Controls 2 07-06-2007 04:01 PM
databind dataset to gridview in gridview mharness ASP .Net 2 06-29-2007 11:38 AM
databind a grid with linkbutton Nikhil Patel ASP .Net 2 10-18-2004 09:12 PM
BUG in DataBind? After .DataBind there are more DataGrid Items than DataSet Rows! Michael ASP .Net Datagrid Control 0 12-29-2003 07:47 PM



Advertisments
 



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