Click here to Skip to main content
16,015,679 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ToolTip in Cell of Datagrid Pin
mnaveed25-Jul-06 3:55
mnaveed25-Jul-06 3:55 
GeneralRe: ToolTip in Cell of Datagrid Pin
varun_khanna1725-Jul-06 19:01
varun_khanna1725-Jul-06 19:01 
QuestionPls help : how to export data from a paged datagrid Pin
Hemangajit25-Jul-06 1:26
Hemangajit25-Jul-06 1:26 
AnswerRe: Pls help : how to export data from a paged datagrid Pin
mnaveed25-Jul-06 4:24
mnaveed25-Jul-06 4:24 
Questionpls help: CreateUserWizard email notification, smtp settings require ssl to send through some smtp hosts Pin
Raido081225-Jul-06 0:59
Raido081225-Jul-06 0:59 
AnswerRe: pls help: CreateUserWizard email notification, smtp settings require ssl to send through some smtp hosts Pin
minhpc_bk25-Jul-06 16:28
minhpc_bk25-Jul-06 16:28 
GeneralRe: pls help: CreateUserWizard email notification, smtp settings require ssl to send through some smtp hosts Pin
Raido081226-Jul-06 9:41
Raido081226-Jul-06 9:41 
QuestionProblem with GridView Pin
bluewavestrider25-Jul-06 0:29
bluewavestrider25-Jul-06 0:29 
Hi there!
I'm using a bound dropdownlist as a column in a gridview and using it's Control parameter in an update query.

//Here the GridView
<asp:GridView ID="GridView1" runat="server" DataKeyNames="price_id"
DataSourceID="SqlDataSource1" AutoGenerateColumns="false"
AutoGenerateEditButton="true">
<Columns>
<asp:BoundField HeaderText="Room" DataField="room_number" />
<asp:BoundField HeaderText="Price ID" DataField="price_id"
ReadOnly="true" />
<asp:BoundField HeaderText="State" DataField="state" />
<asp:TemplateField HeaderText="RoomType">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1"
DataSourceID="SqlDataSource2" DataTextField="room_type"
DataValueField="price_id" SelectedValue='<%#Bind("price_id")%>'
runat="server">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="MySQL Connection String" ProviderName="System.Data.Odbc"
SelectCommand="SELECT room_number, price_id, state, expiry_date_if_occupied, comments FROM rooms;"
UpdateCommand="UPDATE rooms SET room_number=?, price_id=?, state=?, expiry_date_if_occupied=?, comments=? WHERE room_number=old_?;" OldValuesParameterFormatString="old_{0}">
<UpdateParameters>
<asp:Parameter Name="room_number" />
<asp:ControlParameter Name="price_id" ControlID="DropDownList1"
PropertyName="SelectedValue" />
<asp:Parameter Name="state" />
<asp:Parameter Name="comments" />
<asp:Parameter Name="room_number" />
</UpdateParameters>
</asp:SqlDataSource>

Problem 1
When I run, and try updating I get this exception: "Could not find control 'DropDownList1' in ControlParameter 'price_id'."
Please help me out with what's wrong with the code.

Problem 2
Note: The second BoundField column (Price_ID) binds to the same field as The DropDownList in the TemplateField.
Because of this, I would like to show the DropDownList only when in Edit mode. i.e The BoundField would be for Readonly mode and the DropDownlist for Edit mode.

Problem 3
Am I using the correct OldValuesParameterFormatString with the placeholder? NB: room_number is the key field

Thanks alot good People!

Live in fragments no longer. Only connect.
AnswerRe: Problem with GridView Pin
minhpc_bk25-Jul-06 16:26
minhpc_bk25-Jul-06 16:26 
QuestionProblem with formating dates Pin
bluewavestrider25-Jul-06 0:22
bluewavestrider25-Jul-06 0:22 
AnswerRe: Problem with formating dates Pin
Jim Conigliaro25-Jul-06 1:53
Jim Conigliaro25-Jul-06 1:53 
QuestionASP.Net2.0 Pin
Avi8024-Jul-06 23:26
Avi8024-Jul-06 23:26 
AnswerRe: ASP.Net2.0 Pin
l0kke26-Jul-06 3:48
l0kke26-Jul-06 3:48 
GeneralRe: ASP.Net2.0 Pin
Avi8026-Jul-06 19:04
Avi8026-Jul-06 19:04 
Questionhow to show(point) multiple selected cities on map Pin
P. S. Pundeer24-Jul-06 23:19
P. S. Pundeer24-Jul-06 23:19 
AnswerRe: how to show(point) multiple selected cities on map Pin
RichardGrimmer25-Jul-06 5:55
RichardGrimmer25-Jul-06 5:55 
GeneralRe: how to show(point) multiple selected cities on map Pin
P. S. Pundeer25-Jul-06 18:57
P. S. Pundeer25-Jul-06 18:57 
Questionneed a code Pin
sandeepraw24-Jul-06 23:17
sandeepraw24-Jul-06 23:17 
AnswerRe: need a code Pin
minhpc_bk25-Jul-06 15:50
minhpc_bk25-Jul-06 15:50 
AnswerRe: need a code Pin
Ista27-Jul-06 7:01
Ista27-Jul-06 7:01 
QuestionDiplay header and footer when gridview is empty Pin
mcgann24-Jul-06 22:57
mcgann24-Jul-06 22:57 
AnswerRe: Diplay header and footer when gridview is empty Pin
minhpc_bk25-Jul-06 15:47
minhpc_bk25-Jul-06 15:47 
QuestionPlease Help me Pin
nannapanenikamalnath24-Jul-06 22:14
nannapanenikamalnath24-Jul-06 22:14 
AnswerRe: Please Help me Pin
_AK_24-Jul-06 22:21
_AK_24-Jul-06 22:21 
AnswerRe: Please Help me Pin
Paddy Boyd24-Jul-06 22:53
Paddy Boyd24-Jul-06 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.