c# - Default text of combobox -
i want default text on combobox have binded combo box list of items...here code of xaml file.
<combobox x:name="projectcombobox" text="{binding projectnamebinding}" itemssource="{binding projectlist, elementname=mainwin}" selectedvaluepath="_id" displaymemberpath="_name" selecteditem="{binding projectnamebindingclass, mode=onewaytosource}" width="130" background="white" borderthickness="1" fontfamily="/timesheet;component/resources/#open sans" fontsize="12" canvas.right="159" canvas.top="8" height="47"> <combobox.itemtemplate> <datatemplate> <textblock text="{binding _name}" textwrapping="wrap"/> </datatemplate> </combobox.itemtemplate> </combobox>
have tried text property
<combobox x:name="projectcombobox" iseditable=true text="{binding projectnamebinding}" ....../>
or
you can use selectedindex property , set 0(selectedindex=0) displays first item in source given.
or
you can in link how display default text "--select team --" in combo box on pageload in wpf?
Comments
Post a Comment