473,776 Members | 1,529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested DDL in GridView ItemTemplates

Hi

I have a FormView that contains a GridView. The GridView is populated
from an ObjectDataSourc e. Two of the columns in the GridView are not
bound, and the values used in Update mode come from dropdowns (inside
of ItemTemplates).

In my ObjectDataSourc e, I have Parameters for the bound fields, and
ControlParamete rs for the DDLs. I cannot seem to access the DDLs since
they are so nested. I've tried:
<asp:ControlPar ameter ControlID="Form View$GridView$D DL" ......[Snipped]
but that doesn't work.
I've tried to do a GridView.FindCo ntrol with the ID of the DDL, but it
doesn't find it.
My GridView looks like this:

<asp:GridView id="CommGridVie w" runat="server"
DataKeyNames="i d" DataSourceID="O bjectDataSource 5"
AutoGenerateCol umns="false" AutoGenerateEdi tButton=true>
<Columns>
<asp:TemplateFi eld>
<EditItemTempla te>
<asp:DropDownLi st ID="DropDownLis tCommFields"
runat="server" DataSourceID="S qlDataSourceCom mFields"
DataValueField= "id" DataTextField=" field" />
</EditItemTemplat e>
<HeaderTemplate >
<b>Field</b>
</HeaderTemplate>
<ItemTemplate >
<%#CommFldLkp(E val("field"))%>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld>
.......[Snipped]

Does anyone know how I can access the values stored in the DDL for use
as ControlParamete rs?

Thanks

Apr 5 '06 #1
2 2382
You need to put the ObjectDataSourc e control within the TemplateField which
contains the DDLs.

"bi*******@gmai l.com" wrote:
Hi

I have a FormView that contains a GridView. The GridView is populated
from an ObjectDataSourc e. Two of the columns in the GridView are not
bound, and the values used in Update mode come from dropdowns (inside
of ItemTemplates).

In my ObjectDataSourc e, I have Parameters for the bound fields, and
ControlParamete rs for the DDLs. I cannot seem to access the DDLs since
they are so nested. I've tried:
<asp:ControlPar ameter ControlID="Form View$GridView$D DL" ......[Snipped]
but that doesn't work.
I've tried to do a GridView.FindCo ntrol with the ID of the DDL, but it
doesn't find it.
My GridView looks like this:

<asp:GridView id="CommGridVie w" runat="server"
DataKeyNames="i d" DataSourceID="O bjectDataSource 5"
AutoGenerateCol umns="false" AutoGenerateEdi tButton=true>
<Columns>
<asp:TemplateFi eld>
<EditItemTempla te>
<asp:DropDownLi st ID="DropDownLis tCommFields"
runat="server" DataSourceID="S qlDataSourceCom mFields"
DataValueField= "id" DataTextField=" field" />
</EditItemTemplat e>
<HeaderTemplate >
<b>Field</b>
</HeaderTemplate>
<ItemTemplate >
<%#CommFldLkp(E val("field"))%>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:TemplateFi eld>
.......[Snipped]

Does anyone know how I can access the values stored in the DDL for use
as ControlParamete rs?

Thanks

Apr 5 '06 #2
OK Thanks. Since I have multiple template fields, do I just put it in
the first template field?

Thanks

Apr 5 '06 #3

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

Similar topics

0
2209
by: hammad.awan_nospam | last post by:
Hello, I am using ASP.NET 2.0. What I have done is nested a gridview inside another column of a gridview using a template data field column declaritively in my web form. Inside this child gridview I have set an ItemStyle property of width 20% for the first templated field which contains a hyperlink control, and an ItemStyle of width 80% for the second templated field which contains a label. Both of these controls are databound to...
3
19345
by: Martin | last post by:
Hi, I have a very frustrating problem that I have researched for countless hours to no avail. There are many posts asking very similar things, however none usefull in my situation. I am using VS 2005 (ASP 2.0) and VB .NET. I have a page with a datalist, a gridview and then other data controls, nested in that order. This all works great, and produces a nice looking page, but I cannot for the life of me figure out how to reference
0
932
by: sloan | last post by:
I'm working on a application where I have 1 page which shows a GridView. I have this page working...with sorting, with paging...and I'm caching the first resultset,... to avoid unnecessary db calls after the first db hit. ... The page needs to be called ... for 3 different reasons.
4
7601
by: Congero | last post by:
I'm trying to find a way to bind hierarchical data to a gridview control. I've been able to do this with some third party controls and was wondering if this functionality is available with the gridview control. Does anyone have a guidance on this? Thanks -- Live long, stay strong
1
1255
by: ram_kri | last post by:
Hi Guys, Here is a uncommon scenario that I had to work on.. I have a GridView which is associated to a DataSource. But I have a couple of columns (item-templates while the rest of the columns are boundfields)which have labels. Now, the datasouce that is bound to the GridView doesnt provide values to the itemTemplate columns. So in the page_load event I manually obtain the data from the DB and then process it, loop through the rows of...
0
4666
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box and also get the datakey (in my case personid) of the the rows selected. Please point me in the right direction. This is what i have so far but i have problem accessing the child gridview in the button click event Cheers, Shilpa. <asp:GridView...
2
2830
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files comprising each report. I want the user to be able to select an arbitrary collection of report files and have them emailed by clicking an "Email selected files" button. Everything displays properly, including the checkboxes for each child row (each...
6
5758
by: RobertTheProgrammer | last post by:
Hi folks, Here's a weird problem... I have a nested GridView setup (i.e. a GridView within a GridView), and within the nested GridView I have a DropDownList item which has the OnSelectedIndexChanged event set on it. This triggers just fine, but within the codebehind of the OnSelectedIndexChanged event, I need to scan through all the entries in the nested GridView (to see if the user changed a value to an already existing value in the...
0
848
by: Sody | last post by:
Hi, is in gridview any way how to control from codebehid if an itemtemplate in gridview will be set to visible = true / false ? here is an example of gridview with more itemtemplates <asp:GridView ID="grdTracking" runat="server" AutoGenerateColumns="False" BorderWidth="0" GridLines="Horizontal" Width="100%"> <FooterStyle /> <Columns> <asp:TemplateField HeaderText="&nbsp;"
0
9628
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8952
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.