Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 17, 2012 07:16 AM by sarathi125
Nov 13, 2012 07:48 AM|LINK
My page contains two elements. A dropdown and a gridview
1) When the page is loaded the dropdown will be populated with some values.
2) I need to select a value from the dropdown.
3) Based on the value the gridview gets populated.
Issue : I have values like 10" valve , laptop , stationary pen, 12"valve etc
When I select laptop from the dropdown, the gridview gets populated with the details of the item.But when I select 10" valve , nothing is getting populated.
I found this issue for all items that contains " in it.
Can anyone please help me on this.
Nov 13, 2012 08:04 AM|LINK
Use sql select command to replace " with a code to store ddl values, also use replace in WHERE condition gridview
Select REPLACE([Computertype],'"','xxx') as ddlvalue
Nov 13, 2012 08:05 AM|LINK
I am using a dropdown value as input value for gridview.
So how can I modify there ???
Nov 13, 2012 08:10 AM|LINK
can you give me a sample code
Nov 13, 2012 10:27 PM|LINK
Check this links...
Nov 13, 2012 10:42 PM|LINK
Your SQL Datasource for Gridview should be something like this..
<asp:SqlDataSource ID="SqlDataSource1" SelectCommand="SELECT [EmployeeID], [FirstName], [LastName] FROM [Employees]WHERE ([EmployeeID] = @EmployeeID)"
<asp:ControlParameter ControlID="DropDownList1" Name="EmployeeID"
PropertyName="SelectedValue" Type="Int32" />
Nov 13, 2012 11:22 PM|LINK
To simplify, use like this
10" valve 10valve
stationary pen statpen
10" valve 00002
stationary pen 00003
use name as ddl text and kode as ddl value, use selectedvalue to filter the gridview
Nov 14, 2012 09:50 AM|LINK
I am getting all those values to the ddl from db via query.
I will post more details with screenshots soon.
(Is there any way to set different values for Name and code for a dropdown that got the values from db)
Nov 14, 2012 09:59 AM|LINK
Sorry for the confusion....but this is the situation.
During page load, my dropdown gets populated from DB.
Sample Values : 10" Valve , Pen drive , 14" laptop, 25" pipe etc
If I select Pen Drive, the gridview gets populated correctly. But if I select
10" Valve,the gridview is not getting populated.
I understood that it is due to "
( Will post screenshots asap )
Nov 14, 2012 10:21 AM|LINK
How are you building the query to fetch data in gridview? and what is the value stored in the table?