c# - WPF DataGrid in ComboBox -


i'm trying add datagrid inside combobox try save screen space on complexed window.

here code:

<combobox grid.row="0" grid.column="0" >     <combobox.itemtemplate>         <datatemplate>             <datagrid itemssource="{binding path=productlist, source={staticresource mainwindowviewmodel}}" autogeneratecolumns="false" width="500" height="80">                 <datagrid.columns>                     <datagridcheckboxcolumn header="selected" isreadonly="false" />                     <datagridtextcolumn header="name" binding="{binding name}" width="100" />                     <datagridtextcolumn header="code" binding="{binding code}" width="100" />                 </datagrid.columns>             </datagrid>         </datatemplate>     </combobox.itemtemplate>     <separator/> </combobox> 

separator hack there 1 object in combobox show datagrid. problem being can't select row or tick checkboxs.

if has suggestions great. cheers.

use expander class, has native function collapsible panel in wpf. msdn: http://msdn.microsoft.com/en-us/library/system.windows.controls.expander.aspx.

source stackoverflow answer: how create collapsible panel in wpf

however, if want make customizable, use headeredcontentcontrol class instead. msdn: http://msdn.microsoft.com/en-us/library/system.windows.controls.headeredcontentcontrol.aspx. general idea modify content visibility when header clicked.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -