Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to get item from data list source???

Reply
Thread Tools

How to get item from data list source???

 
 
Mary Kerrigan
Guest
Posts: n/a
 
      12-02-2003
OK - I've been wrestling with this all day: I have a DataList:

<aspataList id="MyList" runat="server" OnItemCommand="pickCat">
<ItemTemplate>
<asp:LinkButton id="myLink" Text='<%# Container.DataItem(
"Subject" ) %>' CommandArgument='<%# Container.DataItem( "Subject" )
%>' Runat="Server"/>
</ItemTemplate>
<SelectedItemTemplate>
<b><%# Container.DataItem( "Subject" ) %></b>
</SelectedItemTemplate>
</aspataList>

How do I reference the (selected) dataitem "SubjectID" in the
code-behind????? This is different from "Subject" - it's in the same
DataSet.

Thanks
 
Reply With Quote
 
 
 
 
Chris Jackson
Guest
Posts: n/a
 
      12-03-2003
The SelectedItem property of the DataGrid type will give you the
DataGridItem object representing this item, and you can use the DataItem
property of this.


--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Mary Kerrigan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> OK - I've been wrestling with this all day: I have a DataList:
>
> <aspataList id="MyList" runat="server" OnItemCommand="pickCat">
> <ItemTemplate>
> <asp:LinkButton id="myLink" Text='<%# Container.DataItem(
> "Subject" ) %>' CommandArgument='<%# Container.DataItem( "Subject" )
> %>' Runat="Server"/>
> </ItemTemplate>
> <SelectedItemTemplate>
> <b><%# Container.DataItem( "Subject" ) %></b>
> </SelectedItemTemplate>
> </aspataList>
>
> How do I reference the (selected) dataitem "SubjectID" in the
> code-behind????? This is different from "Subject" - it's in the same
> DataSet.
>
> Thanks



 
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
embedding python: simulating sequence get item / set item methods Johannes Zellner Python 1 01-17-2006 01:09 AM
why writing list to file puts each item from list on seperate line? homepricemaps@gmail.com Python 5 12-31-2005 05:21 AM
List index method for complex list item types? techiepundit@futurepundit.com Python 4 12-31-2005 03:44 AM
Can we use Data Grid in Item Template of Data List Control Shahid Saleem ASP .Net 1 08-26-2005 01:28 PM
Change style of a single row of the item list of datagrid, based on a field value of current item... QUASAR ASP .Net Datagrid Control 6 01-17-2004 07:46 PM



Advertisments