wpf - ComboxEdit that display many members of ObservableCollection -
i want display data in comboboxedit; example have model contains
public class foo { public long id{get ; set ;} public string firstname {get ; set ;} public string lastname{get ; set ;} public string town {get ; set ;} }
i have observablecollection contains many rows of model. in view, want display comboboxedit showing firstname , lastname columnfilter also. else used?
all examples welcome.
use lookupedit instead:
<window ... xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" xmlns:my="clr-namespace:mynamespace" ...> <window.resources> <window.resources> <my:myobservablecollection x:key="myobservablecollection" /> </window.resources> ... <dxg:lookupedit autopopulatecolumns="false" itemssource="{binding path=data, source={staticresource myobservablecollection}}" valuemember="id" displaymember="id"> <dxg:lookupedit.popupcontenttemplate> <controltemplate> <dxg:gridcontrol name="part_gridcontrol"> <dxg:gridcontrol.columns > <dxg:gridcolumn header="first name" fieldname="firstname" visibleindex="0"/> <dxg:gridcolumn header="last name" fieldname="lastname" visibleindex="1" /> </dxg:gridcontrol.columns> </dxg:gridcontrol> </controltemplate> </dxg:lookupedit.popupcontenttemplate> </dxg:lookupedit>
Comments
Post a Comment