Combobox selected value(selected item) binding in silverlight using c#


i have combobox in silverlight application..

                                                          

 <combobox fontweight="normal"
                                                          grid.row="1"
                                                          grid.column="4"
                                                          x:name="ddlservice"
                                                          dropdownclosed="ddlservice_dropdownclosed"

                                                          selecteditem="{binding path=servicename,notifyonvalidationerror=true, validatesonexceptions=true, updatesourcetrigger=propertychanged, mode=twoway}"
                                                          style="{staticresource comboboxstyle}">

i'm binding selected value or selected item combo box database..

but value not binded selected value or item combo..instead of showing selected value,it showing values once again..

code follows

if (ddlservice.items.count>0)
                                {
                                    if (ddlservice.itemssource!=null)
                                    {
                                        ddlservice.selectedvalue = servicename;//this name retrieved database..
                                        ddlservice.selecteditem = servicename;//this name retrieved database..
                                    }

}

the property of combo,updatesourcetrigger ,i have changed default,explicit , propertychanged..

then not getting binded value selected value.

any 1 me out resolve this.

thank you.

hi,

you should not bind servicename directly combobox.

here blog talked this,please try it:

http://www.microapplications.com/blog/archive/2009/05/07/330.aspx

if still have problems,please let me know.

best regards,


we trying better understand customer views on social support experience, participation in interview project appreciated if have time. helping make community forums great place.
click here participate survey.






Silverlight  >  Silverlight 5



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........