473,762 Members | 5,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SqlDataSource param in ItemTemplate can't find GridView bound cont

I'm trying to load a DropDownList in a Gridview from a secondary
SqlDataSource but I get an exception complaining that the ControlParamete r's
ControlId isn't found.
"Could not find control 'JoinDate' in ControlParamete r 'JoinDate'."

<asp:BoundFie ld DataField="Join Date" HeaderText="Joi ned"
SortExpression= "JoinDate" />
<asp:TemplateFi eld HeaderText="Dat es">
<ItemTemplate >
<asp:DropDownLi st ID="RideDatesDr opDownList" runat="server"
OnDataBound="Sh owHideDatesDDL"
DataSourceId="R ideDatesSqlData Source" DataTextField=" RideDate"
DataValueField= "RideDate"
DataTextFormatS tring="{0:MMM yyyy}" CssClass="waDro pDownList">
</asp:DropDownLis t>
<asp:SqlDataSou rce ID="RideDatesSq lDataSource" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:myDB %>"
ProviderName="S ystem.Data.SqlC lient"
SelectCommand=" GetCurrentRides Taken_desc"
SelectCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Regi strantIdLabel"
Name="Registran tId" Type="Int32" />
<asp:ControlPar ameter ControlID="Join Date" Name="JoinDate"
Type="DateTime" />
</SelectParameter s>
</asp:SqlDataSour ce>
</ItemTemplate>
</asp:TemplateFie ld>

Any illumination would be appreciated, I'm stuck ;)
Apr 12 '06 #1
2 4215
The BoundField object renders different objects based on the databound
control in which it is used. It is not a control that has an ID. You might
replace the BoundField with a TemplateField inside which you bind another
server control, e.g. a Label, give it an ID and refer to it using the
Controlparamete r.

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Dabbler" wrote:
I'm trying to load a DropDownList in a Gridview from a secondary
SqlDataSource but I get an exception complaining that the ControlParamete r's
ControlId isn't found.
"Could not find control 'JoinDate' in ControlParamete r 'JoinDate'."

<asp:BoundFie ld DataField="Join Date" HeaderText="Joi ned"
SortExpression= "JoinDate" />
<asp:TemplateFi eld HeaderText="Dat es">
<ItemTemplate >
<asp:DropDownLi st ID="RideDatesDr opDownList" runat="server"
OnDataBound="Sh owHideDatesDDL"
DataSourceId="R ideDatesSqlData Source" DataTextField=" RideDate"
DataValueField= "RideDate"
DataTextFormatS tring="{0:MMM yyyy}" CssClass="waDro pDownList">
</asp:DropDownLis t>
<asp:SqlDataSou rce ID="RideDatesSq lDataSource" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:myDB %>"
ProviderName="S ystem.Data.SqlC lient"
SelectCommand=" GetCurrentRides Taken_desc"
SelectCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Regi strantIdLabel"
Name="Registran tId" Type="Int32" />
<asp:ControlPar ameter ControlID="Join Date" Name="JoinDate"
Type="DateTime" />
</SelectParameter s>
</asp:SqlDataSour ce>
</ItemTemplate>
</asp:TemplateFie ld>

Any illumination would be appreciated, I'm stuck ;)

Apr 12 '06 #2

Super duper! I can do that.

Thanks much.

"Phillip Williams" wrote:
The BoundField object renders different objects based on the databound
control in which it is used. It is not a control that has an ID. You might
replace the BoundField with a TemplateField inside which you bind another
server control, e.g. a Label, give it an ID and refer to it using the
Controlparamete r.

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Dabbler" wrote:
I'm trying to load a DropDownList in a Gridview from a secondary
SqlDataSource but I get an exception complaining that the ControlParamete r's
ControlId isn't found.
"Could not find control 'JoinDate' in ControlParamete r 'JoinDate'."

<asp:BoundFie ld DataField="Join Date" HeaderText="Joi ned"
SortExpression= "JoinDate" />
<asp:TemplateFi eld HeaderText="Dat es">
<ItemTemplate >
<asp:DropDownLi st ID="RideDatesDr opDownList" runat="server"
OnDataBound="Sh owHideDatesDDL"
DataSourceId="R ideDatesSqlData Source" DataTextField=" RideDate"
DataValueField= "RideDate"
DataTextFormatS tring="{0:MMM yyyy}" CssClass="waDro pDownList">
</asp:DropDownLis t>
<asp:SqlDataSou rce ID="RideDatesSq lDataSource" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:myDB %>"
ProviderName="S ystem.Data.SqlC lient"
SelectCommand=" GetCurrentRides Taken_desc"
SelectCommandTy pe="StoredProce dure">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Regi strantIdLabel"
Name="Registran tId" Type="Int32" />
<asp:ControlPar ameter ControlID="Join Date" Name="JoinDate"
Type="DateTime" />
</SelectParameter s>
</asp:SqlDataSour ce>
</ItemTemplate>
</asp:TemplateFie ld>

Any illumination would be appreciated, I'm stuck ;)

Apr 12 '06 #3

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

Similar topics

5
4480
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a ControlParameter <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XYZ %>"
15
26929
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3" DataTextField="name" DataValueField="ID"></asp:DropDownList><asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
4
2044
by: Dabbler | last post by:
I need to convert a CompanyId in one table to Company Name from another table for an ItemTemplate. I thought I would just add another SqlDataSource but not sure how to eval with the CompanyId parameter for the where clause in the select. Any clues would be appreciated.
3
4534
by: simonZ | last post by:
In gridView I have dropdown list : <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="ProductID" HeaderText="ProductID" InsertVisible="False"ReadOnly="True" SortExpression="ProductID" /> <asp:BoundField DataField="ProductName" HeaderText="ProductName" SortExpression="ProductName" />
0
1615
by: Giovanni | last post by:
I was wondering if someone would be able to help me with the following: Simply put, I have built an ASP.NET 2.0 WebUserControl (UC1). UC1 contains: A GridView which is bound to an SQLDataSource control (Stored Procedure with 2 input parameters). The GridView contains 3 columns (QuestionNumber, QuestionText, and a TemplateField). The TemplateField is initially empty at design time and is populated with other UserControls which are...
1
7879
by: Mike P | last post by:
When you use a SqlDataSource to hook up data to a GridView it seems to be to be very inflexible. For example, I want to create my own Delete button with my own code and I also want to create a popup warning for the user before delete takes place. Whenever I do this with a SqlDataSource, I get the error 'Deleting is not supported by data source 'SqlDataSource1' unless DeleteCommand is specified.' Which means I have to specify a sproc or...
2
9898
by: Ned Balzer | last post by:
I'm trying to create a formview bound to a sqldatasource, and use a stored procedure to insert data from the formview into several tables. I have some simplified code below, the real code is much longer but this should illustrate the problem: <asp:FormView ID="bookFormView" runat="server" DataSourceID="bookSqlDataSource"> <ItemTemplate> <asp:textBox id="name" text='<%# Eval("name") %>'
2
6327
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
Hi, I want to create a mailto link from data coming from an SQLDataSource. How do I have to change the following code to get it working? The mailto works, outlook starts with a new message, but the email address has not been filled in because I don’t know how to pass the email variable into the mailto command. <asp:HyperLink runat="server"> <A href="mailto:">
0
2139
by: LiamLiamLiam | last post by:
G'day all. I having a problem with my formview. I'll ty to explain my situation as best as i can. I have a page with a search field at the top which is just a simple asp:textbox. Below that i have a gridview which displays the results of the search. if no search is entered, then the gridview shows all records. Below the gridview i have a formview for inserting and editing the records. when a user clicks on one of the records in the...
0
10137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9989
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...
1
9927
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7360
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
6640
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
5268
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...
1
3914
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
2788
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.