Sunday, 15 February 2015

c# - List with Associated Detail Box GUI -



c# - List with Associated Detail Box GUI -

i'm working in c# / wpf , i'm trying develop window has next layout:

the thought click each item in datagrid , see associated details of item in command below datagrid. i'm not sure kind of command house expanded details. question around options how accomplish kind of ui, i'm novice @ wpf.

a neat , easy solution have 2 separate views. 1 embedded in other. grid listed items main view. details panel sec view embedded in first one.

to communicate item selected , details should displayed using binding. on panel displaying details using datacontext , bind item selected on grid. and, on grid, communicate item has been selected using selectedvalue.

below sample should give thought what's relation between views.

<window ... xmlns:view="clr-namespace:sampleproject.view" ... /> <grid> <grid.rowdefinitions> <rowdefinition height="*"/> <rowdefinition height="*"/> </grid.rowdefinitions> ... <!-- let's assume sec view defined in view folder --> <view:detailsview datacontext="{binding selecteditem, updatesourcetrigger=propertychanged, mode=twoway}"/> <datagrid itemssource="{binding items, updatesourcetrigger=propertychanged, notifyonsourceupdated=true}" selectedvalue="{binding selecteditem, updatesourcetrigger=propertychanged}" > ...

the items collection of products want display in datagrid. should implemented in viewmodel of main view. selecteditem property on viewmodel.

note sample give thought what's construction of solution might it's far finish solution. still, hope help understand how go on project.

main point communication between panels done utilize of binding datacontext (on detailsview) , selectedvalue (on grid).

c# wpf datagrid

No comments:

Post a Comment