c# - Update DataGrid to EF -
i display data datagrid
in way:
var display = (from r in ve.folders.include("hosting_company1") select new repoclass{ id = r.folder_id,name= r.full_name, hosname= r.hosting_company1.housing_name }).tolist(); dg1.itemssource = display;
and in xaml
:
<datagrid canuseraddrows="false" autogeneratecolumns="false" name="dg1"> <datagrid.columns> <datagridtextcolumn binding="{binding path=id, mode=twoway}" header="id"/> <datagridtextcolumn binding="{binding path=name, mode=twoway}" header="name" /> <datagridtextcolumn binding="{binding path=hosname, mode= twoway}" header="company" /> </datagrid.columns> </datagrid>
how update data ef
?
if ve datacontext, need call ve.savechanges(). pass observable collection datagrid changes easier manage.
Comments
Post a Comment