c# - How to partial update DataGrid - only for one column -
how partial update of datagrid
in wpf
? want update 1 column , values inside of datagrid
without refreshing whole grid. using timer reload grid latest data every xx seconds. how can that?
there double click event on grid row, when whole grid refreshes if user clicks @ moment won't handle double click
. same if have hyperlink
column. believe if partial update can handle such case?
binding is:
datagrid.datacontext = mycollection; datagrid.items.refresh();
and idea refreshing of grids , have similar issue: refresh datagrid
on timer tick event when value of mycollection
has changed.
in wpf work data elements rather ui elements... instead of trying manipulate column value of each row in datagrid
, should think data binding collection of custom class instances datagrid.itemssource
property , update whichever property of classes data bound column. see example:
<datagrid itemssource="{binding items}" ... />
...
foreach (yourclass item in items) { item.propertythatisdataboundtoyourcolumn = somenewvalue; }
to make work properly, custom yourclass
class should implement inotifypropertychanged
interface.
Comments
Post a Comment