DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 15 Aug 2007 07:06:07 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Mike D
          2    Mike D


Accessing dropdownlists in a datalist control   
I am trying to develop a tape management application which tracks backup 
tapes for 3 servers.  I need to be able to add new tapes and retire old/bad 
tapes.  I also need to track the location of the tapes between three 
locations, the 'In Service Date' of each tape, and number of times each tape 
has been loaded into its server. 
So far I have three tables, one for tape mgmt (serverID, TapeID and 'In 
Service Date'), one for tape status (TapeID, Status, Date) and one for 
retired tapes (TapeID, RetireCode, RetiredBy, Date).  I have everything 
working except for the capability of updating the status of the tapes (and 
Retiring tapes, but if I can get this working then I can do it).

Right now I am using a datalist (so I can display two columns - 50+ tapes at 
a time) to display the tapes for a server depending on which radiobutton 
(autopostback) the user clicks.  The datalist has one ItemTemplate.

<ItemTemplate>
   < %# PadTapeID(DataBinder.Eval(Container.DataItem,"TapeID")) %>           
              
    <asp:DropDownList ID="ddlTapeStatus" runat="server">
          <asp:ListItem Value="1">Safe</asp:ListItem>
          <asp:ListItem Value="2">Library</asp:ListItem>
          <asp:ListItem Value="3">Iron Mountain</asp:ListItem>
          <asp:ListItem Value="0">Retire</asp:ListItem>
     </asp:DropDownList> 
   <%# DateTime.Parse(DataBinder.Eval(Container.DataItem,"In Service 
Date").ToString()).ToShortDateString() %>
      
   <%# LibraryCount(DataBinder.Eval(Container.DataItem,"TapeID"))%>
</ItemTemplate>

I guess the first question is - am I doing this the best way.  Second - if I 
am, how do I access loop over each data row in order to pass the TapeID and 
the dlTapeStatus.SelectedValue to a method which will insert the data into 
the database?

-- 
Regards,

Mike D
Coding in C# since Feb 2007
Date:Wed, 15 Aug 2007 07:06:07 -0700   Author:  

RE: Accessing dropdownlists in a datalist control   
I added a Label for each of the DataBinder items so now I can possibly get 
the TapeID.  Am I on the right track?

-- 
Regards,

Mike D
Coding in C# since Feb 2007


"Mike D" wrote:


> I am trying to develop a tape management application which tracks backup 
> tapes for 3 servers.  I need to be able to add new tapes and retire old/bad 
> tapes.  I also need to track the location of the tapes between three 
> locations, the 'In Service Date' of each tape, and number of times each tape 
> has been loaded into its server. 
> So far I have three tables, one for tape mgmt (serverID, TapeID and 'In 
> Service Date'), one for tape status (TapeID, Status, Date) and one for 
> retired tapes (TapeID, RetireCode, RetiredBy, Date).  I have everything 
> working except for the capability of updating the status of the tapes (and 
> Retiring tapes, but if I can get this working then I can do it).
> 
> Right now I am using a datalist (so I can display two columns - 50+ tapes at 
> a time) to display the tapes for a server depending on which radiobutton 
> (autopostback) the user clicks.  The datalist has one ItemTemplate.
> 
> <ItemTemplate>
>    < %# PadTapeID(DataBinder.Eval(Container.DataItem,"TapeID")) %>           
>               
>     <asp:DropDownList ID="ddlTapeStatus" runat="server">
>           <asp:ListItem Value="1">Safe</asp:ListItem>
>           <asp:ListItem Value="2">Library</asp:ListItem>
>           <asp:ListItem Value="3">Iron Mountain</asp:ListItem>
>           <asp:ListItem Value="0">Retire</asp:ListItem>
>      </asp:DropDownList> 
>    <%# DateTime.Parse(DataBinder.Eval(Container.DataItem,"In Service 
> Date").ToString()).ToShortDateString() %>
>       
>    <%# LibraryCount(DataBinder.Eval(Container.DataItem,"TapeID"))%>
> </ItemTemplate>
> 
> I guess the first question is - am I doing this the best way.  Second - if I 
> am, how do I access loop over each data row in order to pass the TapeID and 
> the dlTapeStatus.SelectedValue to a method which will insert the data into 
> the database?
> 
> -- 
> Regards,
> 
> Mike D
> Coding in C# since Feb 2007
Date:Wed, 15 Aug 2007 08:00:02 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us