I have attached the code that does value of dropdownlist which is ddorders and population grid according to that. My problem is I want to use this grid also without dropdown, I have a linkbutton that on that click event I want to pass the value of the label1
to as a ControlParameter instead of getting the ddorders , want to give to label1 value.
wilsonnet
Member
22 Points
174 Posts
how to use grid in two different ways
Oct 01, 2009 10:17 PM|LINK
I have attached the code that does value of dropdownlist which is ddorders and population grid according to that. My problem is I want to use this grid also without dropdown, I have a linkbutton that on that click event I want to pass the value of the label1 to as a ControlParameter instead of getting the ddorders , want to give to label1 value.
<table width="100%"> <tr> <td align="right" > Order ID: <asp:DropDownList ID="ddorders" runat="server" AutoPostback="True" DataSourceID="dsdetail" DataTextField="orderID" DataValueField="orderID"/></td> </tr> </table> <asp:SqlDataSource ID="dsdetail" runat="server" ConnectionString="<%$ ConnectionStrings:mystring %>" SelectCommand="details" SelectCommandType="StoredProcedure" > <SelectParameters> <asp:ControlParameter Name="orderID" Type="Int32" ControlID="ddorders" /> </SelectParameters> </asp:SqlDataSource> <table width="100%"> <tr> <td align="center"> <radG:RadGrid ID="rgdetail" runat="server" DataSourceID="dsdetail" > <MasterTableView AutoGenerateColumns="false"> <Columns> ... </Columns>wilsonnet
Member
22 Points
174 Posts
Re: how to use grid in two different ways
Oct 02, 2009 01:59 AM|LINK
anybody has any idea?
wilsonnet
Member
22 Points
174 Posts
Re: how to use grid in two different ways
Oct 02, 2009 07:27 PM|LINK
easiest way to do that I found was
label1.Text = id.ToString();
dsDetail.SelectParameters["orderID"].DefaultValue = id.ToString();
Is that good way to do that or do I need to use rowcommand or something like that?
Forward Sun ...
All-Star
21378 Points
1461 Posts
Re: how to use grid in two different ways
Oct 07, 2009 08:54 AM|LINK
Hi wilsonnet,
It's really good!
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.