Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Template fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bobby - 04 Sep 2007 21:52 GMT
I have a Grid view which I attached with dtasource ddSource1.  I have a
column in it "Roles" Which I converted as a Template field and create a
dropdown list and attached to another datasource ddSource2
which is from another data table.  but it is not working.

<asp:TemplateField HeaderText="Roles" SortExpression="Roles">
                   <EditItemTemplate>
                       <asp:Label ID="Label1" runat="server" Text='<%#
Eval("Roles") %>'></asp:Label><br />
                       <asp:DropDownList ID="DropDownList1" runat="server"
DataSourceID="ObjectDataSource22"
                           DataTextField="RoleName"
DataValueField="RoleName" SelectedValue='<%# Bind("RoleName") %>'>
                       </asp:DropDownList>
                       <br />
                   </EditItemTemplate>
                   <ItemTemplate>
                       <asp:Label ID="Label1" runat="server" Text='<%#
Bind("Roles") %>'></asp:Label>
                   </ItemTemplate>
               </asp:TemplateField>
Muhammad Naveed Yaseen - 05 Sep 2007 02:16 GMT
Hopefully you are aware that,,,

1) It is ObjectDataSource22 instead of ddlSource2
2) It is in EditItemTemplate which only becomes visible in edit mode.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.