473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 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 5920

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. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.