472,790 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,790 software developers and data experts.

Access dropdownlist Nested in GridView in ItemTemplate Formview

How do I access a dropdownlist that is nested within a Formview
ItemTemplate Gridview Template?

I want to see a label (lgbTimeKeep ! TextValue of ddlName
dropdownlist) instead of a dropdownlist in the FormView ItemTemplate
Nested Gridview ddlName ItemTemplate. My label is named lgvTimeKeep
and the dropdownlist name is ddlName.

Thanks!

MCJ

Below is some sample code:

<ItemTemplate>
<asp:Label ID="Time_IDLabel" runat="server" Text='<%#
Eval("Time_ID") %>' style="left: 137px; position: absolute; top: 77px"
Font-Size="Small" ForeColor="Red" Width="160px"></asp:Label>
<asp:Label ID="lAmount" runat="server" Font-Size="Small"
Style="left: 24px; position: absolute;
top: 188px" Text="Amount" Width="106px"></asp:Label>

<br />
<asp:Label ID="D_NumberLabel" runat="server" Text='<%#
Bind("D_Number") %>' style="left: 137px; position: absolute; top:
133px" Font-Size="Small" Width="160px"></asp:Label>
<asp:Label ID="lDNumber" runat="server" Font-Size="Small"
Style="left: 21px;
position: absolute; top: 133px" Text="D Number"
Width="110px"></asp:Label>
<asp:Label ID="lRate" runat="server" Font-Size="Small"
Style="left: 24px; position: absolute; top: 161px"
Text="Rate" Width="106px"></asp:Label>
<asp:Label ID="lLocation" runat="server" Font-Size="Small"
Style="left: 24px; position: absolute; top: 215px"
Text="Location" Width="104px"></asp:Label>

&nbsp;<br />

&nbsp;

<asp:TextBox ID="txt_Style" runat="server"
BorderColor="Gray" BorderWidth="1px"

Font-Size="X-Small" Height="75px" Style="left: 625px;
position: absolute; top: 135px"

TextMode="MultiLine"
OnTextChanged="txt_Style_TextChanged" BorderStyle="Inset"
OnPreRender="txt_Style_PreRender" Width="169px"></asp:TextBox>

<asp:Label ID="lTimeKeeper" runat="server" Font-
Size="Small" Style="left: 24px; position: absolute;

top: 104px" Text="Time Keeper" Width="106px"></
asp:Label>

&nbsp;

<asp:Label ID="lComments" runat="server" Font-Size="Small"
Height="43px" Style="left: 24px;

position: absolute; top: 244px" Text="Comments/Notes"
Width="106px"></asp:Label>

&nbsp;&nbsp;
<asp:Label ID="lblDAmount" runat="server" Font-
Size="Small" Style="left: 534px; position: absolute;
top: 291px"></asp:Label>
<asp:Label ID="lblTimeKeeper" runat="server" Font-
Size="Small" OnPreRender="lblTimeKeeper_PreRender"
Style="left: 137px; position: absolute; top: 104px"
Width="137px"></asp:Label>
&nbsp; &nbsp;&nbsp;
<asp:Label ID="lblBHour" runat="server" Font-Size="Small"
OnPreRender="lblBHour_PreRender"
Style="left: 534px; position: absolute; top: 239px"
Width="97px"></asp:Label>
<asp:Label ID="lBilled" runat="server" Font-Size="Small"
Style="left: 396px; position: absolute;
top: 239px" Width="138px">Total Billed Hours</
asp:Label>
<asp:Label ID="lNonBilled" runat="server" Font-
Size="Small" Style="left: 396px; position: absolute;
top: 264px" Width="138px">Total Non-Billed Hours</
asp:Label>
<asp:Label ID="lTotal" runat="server" Font-Size="Small"
Style="left: 396px; position: absolute;
top: 291px" Width="138px">Total Dollar Amount</
asp:Label>
<asp:Label ID="lblNBHour" runat="server" Font-Size="Small"
Style="left: 534px; position: absolute;
top: 264px" Width="97px"></asp:Label>
<br />
&nbsp;
<asp:LinkButton ID="lbtnDetails" runat="server"
CausesValidation="False" Font-Size="Small"
OnClick="lbtnDetails_Click" Style="left: 369px;
position: absolute; top: 137px"
Width="78px">View Details</asp:LinkButton>
<asp:TextBox ID="txtOutput" runat="server"
BorderColor="Red" BorderStyle="Dashed"
Font-Bold="True" Font-Size="XX-Small" Height="96px"
ReadOnly="True" Rows="2"
Style="z-index: 134; left: 687px; position: absolute;
top: 220px" TextMode="MultiLine"
ToolTip="Messages" Visible="False" Width="106px"></
asp:TextBox>
<asp:SqlDataSource ID="sqlLocation" runat="server"
ConnectionString="<%$ ConnectionStrings:conTime_Keep %>"
SelectCommand="SELECT [LocationID], [Location_Desc]
FROM [v_Location] ORDER BY [Location_Desc]">
</asp:SqlDataSource><asp:DropDownList
ID="ddlTime_Keeper_ID" runat="server"
DataSourceID="sqlTime_Keeper_Name"
DataTextField="Name" DataValueField="Emp_IDX" Font-
Size="Small" SelectedValue='<%# Bind("Time_Keeper_ID") %>'
Style="left: 189px; position: absolute; top: 104px"
Width="108px" Visible="False">
</asp:DropDownList>
<asp:DropDownList ID="ddlLocation" runat="server"
DataSourceID="sqlLocation" DataTextField="Location_Desc"
DataValueField="LocationID" Font-Size="Small"
SelectedValue='<%# Bind("Location") %>'
Style="left: 222px; position: absolute; top: 215px"
Width="75px" Visible="False">
</asp:DropDownList>
<asp:Label ID="lTime" runat="server" Font-Size="Small"
Style="left: 519px; position: absolute;
top: 78px" Text="Time" Width="97px"></asp:Label>
<asp:Label ID="lDate" runat="server" Font-Size="Small"
Style="left: 519px; position: absolute;
top: 107px" Text="Date" Width="97px"></asp:Label>
<asp:Label ID="Label1" runat="server" Font-Size="Small"
Style="left: 519px; position: absolute;
top: 135px" Text="Case Style/Name" Width="97px"></
asp:Label>
<asp:Label ID="lRecordID" runat="server" Font-Size="Small"
Style="left: 24px; position: absolute;
top: 77px" Text="Record ID" Width="106px"></asp:Label>
<asp:Label ID="lEvents" runat="server" Font-Size="Small"
Style="left: 24px; position: absolute;
top: 311px" Text="Events" Width="106px"></
asp:Label &nbsp; &nbsp;
<br />
<asp:CheckBox ID="chkBillStatus" runat="server" Checked='<
%# Bind("Bill_Status_ID") %>'
Font-Size="Small" Height="18px" Style="left: 325px;
position: absolute; top: 185px"
Text="Billable Hours?" Width="133px" Enabled="False" /
>
<asp:Label ID="lblLocation" runat="server" Font-
Size="Small" OnPreRender="lblLocation_PreRender"
Style="left: 137px; position: absolute; top: 215px"
Width="160px"></asp:Label>
<asp:Label ID="lDetails" runat="server" Font-Size="Small"
Style="left: 22px; position: absolute;
top: 537px" Text="Time Events and Details"
Width="163px" Font-Bold="True" Visible="False"></asp:Label>
<asp:GridView ID="gvMain" runat="server"
AutoGenerateColumns="False" DataKeyNames="Time_ID"
DataSourceID="sqlGVMain1" Font-Size="X-Small"
Style="left: 27px; position: absolute;
top: 552px" BorderColor="Gray" BackColor="Transparent"
Width="758px" AllowSorting="True" GridLines="None" Visible="False">
<Columns>
<asp:BoundField DataField="Time_ID"
HeaderText="ID#" InsertVisible="False" ReadOnly="True"
SortExpression="Time_ID" >
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" />
</asp:BoundField>
<asp:TemplateField HeaderText="Time Keeper"
SortExpression="Time_Keeper_ID">
<EditItemTemplate>
<asp:DropDownList ID="ddlName"
runat="server" DataSourceID="sqlTime_Keeper_Name"
DataTextField="Name"
DataValueField="Emp_IDX" Font-Size="X-Small" SelectedValue='<%#
Bind("Time_Keeper_ID") %>'
Width="120px">
</asp:DropDownList>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left"
Width="110px" />
<ItemTemplate>

Mar 27 '07 #1
0 5888

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robert Smith jr. | last post by:
Hello, Please pardon my newbie question ... I am building an ASP.NET page that displays a recordset with a Delete statement enabled (this all works fine). I want to Insert the current row...
4
by: P. Yanzick | last post by:
Hello, I've been playing with master/detail views as well as editing in the gridview, and I ran across a strange problem that I am not exactly sure where to go to try to solve. I have 2...
6
by: Dabbler | last post by:
I have a dropdownlist in a GridView ItemTemplate. I need to bind the ddl to an SqlDataSource, then have a value from a boundfield in the row be passed as the keyfield for select where clause. Im...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
0
by: ThePurpleCat | last post by:
Hi, I'm a newbie to ASP.NET programming but not to Visual Studio. I'm having trouble getting my Master-Details page to work. I have a page enabled GridView which is linked to a FormView control...
1
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList is...
0
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList...
0
by: Moneypenny | last post by:
Hi there, I have a Gridview control which has a dropdownlist in every row. The dropdowns are populated dynamically from a database (so the content is different in each row. There is also a select...
3
by: RobertTheProgrammer | last post by:
Hi folks, I've got another problem. Basically, I'm trying to use a nested GridView, however the nexted GridView displays no values (even though in debug I'm getting valid values into my DataSet. ...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.