Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i am using dropdownlist in gridview as

HTML
 <asp:DropDownList ID="drpstatus" Style="outline: 0" runat="server" SelectedValue='<%#Eval("status_value")%>'>
<asp:ListItem Text="Inactive" Value="0">
<asp:ListItem Text="Active" Value="1">
<asp:ListItem Text="Rejected" Value="2">

when i bind 1st time it show correct selected value but when i change the value through another webform and refresh this page the value still remains same and i checked in database it has changed but not it is not changing in dropdown

please suggest
Posted
Updated 12-Jun-12 0:16am
v2
Comments
RDBurmon 13-Jun-12 9:35am    
Thanks Everyone who replied to this thread , So Amol_Joshi, I think you have got enough responses and you should be able to mark it as your answer and close the thread. Please do so.

Make AutoPostback Property = TRUE of your dropDownList.
 
Share this answer
 
XML
<asp:DropDownList <big>AutoPostBack="true"</big> ID="drpstatus" Style="outline: 0" runat="server" SelectedValue='<%#Eval("status_value")%>'>
<asp:ListItem Text="Inactive" Value="0">
<asp:ListItem Text="Active" Value="1">
<asp:ListItem Text="Rejected" Value="2">



try this,

All the best :-)
 
Share this answer
 
v2
Comments
Vani Kulkarni 12-Jun-12 7:00am    
My 5! Good Answer
The Doer 12-Jun-12 7:32am    
thanks for appreciation !
Hi can u post ur binding code?

u need to bind that grid view on page load without any condtion
or u need to refill ur dataset
 
Share this answer
 
1) Put AutopostBack="true" in Dropdownlist control
 
Share this answer
 
set the "AutoPostBack" property of Drop-down list to TRUE. then it will show the correct result
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900