raja ramesh

raja ramesh

  • NA
  • 50
  • 108.4k

Dropdownlist selectedvalue always null while changing dynamically in c#code !h

Oct 19 2011 8:38 AM
Hi, 
        I am working on windows applications.
var pinCodeObject=.....;//I got pincode object with my logic
I have one statedropdownlist
for the following code,

statedropdownlist.selectedvalue=pinCodeObject.Statecode;

In this case I am getting pinCodeObject.Statecode is some value(not null)
but after executing this line also statedropdownlist.selectedvalue is null 

note:I bound statedropdownlist items in form load event with values which are pinCodeObject.Statecode  and text is state names.

Please tel me how can i set selectedvalue dynamically in code

Answers (2)