c# - How to make List variable appear in DataBinding UI when using WPF in Visual Studio? -



c# - How to make List<Object> variable appear in DataBinding UI when using WPF in Visual Studio? -

i'm in process of learning wpf , exploring info binding. have datagrid command on form, , in c# code form have list<string> variable.

i want able utilize properties ui datagrid in designer bind list<string> datagrid. cannot figure out need or need in ui this.

this doing:

click datagrid in ui designer create active control. move properties window. scroll downwards itemssource property. click on field , ui source, path, converter , options pops up.

and when point no longer know do.

i not want accomplish writing/modifying xaml. want know how works using ui.

having never used designer before, can't totally sure (your utilize case isn't quite clear either).

that beingness said, in designer

set "binding type" "data context" select "custom" text box (needed me because doesn't see datacontext) type name of property in "path" field (you can bind properties) hit ok.

note same writing in xaml:

<datagrid itemssource="{binding myitemcollection}"/> <!-- or --!> <datagrid itemssource="{binding path=mytitemscollection}"/>

there's reason no 1 uses designer....

the other options more "advanced" binding concepts don't utilize on itemssource properties.

note datagrid poor selection displaying strings. listview or listbox much improve choices, don't assume info has multiple pieces (like datagrid does).

c# wpf data-binding

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -