473,405 Members | 2,171 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,405 software developers and data experts.

How can I refeer to controls placed in TemplateField

Hi

I'm building a web site where some users can create receivables
(invoices). This website will support several organisations and
different users migth have responibility for more that one
organisation.

My problem is when I'm buliding this receivables page. The receivable
are entered through a asp.net DetailsView. The first thing a user will
do i to choose organisation. This is done by adding a DropDownList in a
TemplateField . Next, the user will find a customer. She will choose
between the customers belonging to the organisation just choosen. Here
comes my problem: I will use a DropDownList in a TemplateField here as
well, but how can this list be filtered by the selection of
organisation?

I have tried to use a where clause and SelectParameter, I'm not sure
how to refeer to the DropDownList in a TemplateField. I seems that the
compiler is not awhere of controls within the DetailsView.

I should mention that I use SQL server as DataSource, and that all
DropDownLists are populated from this DataSource.

Jun 16 '06 #1
1 2066
You can't directly access the controls under the template because they're
just a "template" of what you'd like created. Typically to access the controls
under a template you access them after the template is created, so I'd suggest
looking into the various events the FormView fires to let you know the template
was created or data bound. So check out DataBinding or DataBound events.

-Brock
http://staff.develop.com/ballen

Hi

I'm building a web site where some users can create receivables
(invoices). This website will support several organisations and
different users migth have responibility for more that one
organisation.

My problem is when I'm buliding this receivables page. The receivable
are entered through a asp.net DetailsView. The first thing a user will
do i to choose organisation. This is done by adding a DropDownList in
a TemplateField . Next, the user will find a customer. She will choose
between the customers belonging to the organisation just choosen. Here
comes my problem: I will use a DropDownList in a TemplateField here as
well, but how can this list be filtered by the selection of
organisation?

I have tried to use a where clause and SelectParameter, I'm not sure
how to refeer to the DropDownList in a TemplateField. I seems that the
compiler is not awhere of controls within the DetailsView.

I should mention that I use SQL server as DataSource, and that all
DropDownLists are populated from this DataSource.

Jun 17 '06 #2

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

Similar topics

0
by: zerosleep | last post by:
I want to do this (some props removed intentionally): ..skin file: <asp:GridView SkinID="GridThemeA"> <RowStyle CssClass="someClass" /> <AlternatingRowStyle CssClass="someAltClass" />...
3
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...
3
by: keithb | last post by:
My code dynamically adds template fields to a GridView control. Everything seems to work OK, except when updating, because I haven't found a way to reference the dynamically added textboxes....
0
by: Mike P | last post by:
I know how to populate a dropdown list in a gridview in edit mode when the dropdown is populated by a datasource (see below eg 1), but how do you populate the dropdown when the dropdown is...
0
by: dba123 | last post by:
Why can't it use callback here??? <asp:GridView ID="GridView_Podcasts" runat="server" EnableSortingAndPagingCallbacks = "True"
2
by: Tony Hedge | last post by:
This seems more diffciult than it should be, can someone provide any insight? Platform is VB 2005, gridview on a web page. I have this code in the aspx file of a GridView control: ...
1
by: mercercreek | last post by:
This one should be easy. Hope someone has a clue. Simple Scenario: Gridview with mulitple rows, each row with a checkbox. The user checks boxes of her choice. Clicks a button on the form (not in...
1
by: jobs | last post by:
CommandArgument does not contain row index when command under Templatefield of- Gridview It appears CommandArgument passed to the rowcommand event does not contain row index when the command is...
6
by: Class | last post by:
Hi all, I create a gridview dynamicly because I don't know the columns in advance. I use the Templatefield to create a linkbutton. Everything fine..I have the postbackurl and it works. But now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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,...
0
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...

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.