binding - How to show a button only when a Silverlight DataGrid row is selected -


how can display button in datagridtemplatecolumn when row selected? i've tried this, of course there no isselected available me. doesn't make sense have isselected property on entity rows bound, , wouldn't want have couple datagrid model tightly. there anyway interface can handle itself?

this have:

<sdk:datagrid name="_categorysummarydatagrid"                minheight="200"                itemssource="{binding elementname=_usercontrol, path=categorysummaries}"               autogeneratecolumns="false" rowdetailsvisibilitymode="visiblewhenselected">     <sdk:datagrid.columns>         <sdk:datagridtextcolumn x:name="_namecolumn" binding="{binding path=name}" header="name" width="auto" isreadonly="true" />         <sdk:datagridtextcolumn x:name="_descriptioncolumn" binding="{binding path=description}" header="description" width="*" isreadonly="true" />         <sdk:datagridtemplatecolumn x:name="_detailscolumn" width="auto">             <sdk:datagridtemplatecolumn.celltemplate>                 <datatemplate>                     <button content="..." tooltipservice.tooltip="view category details"                              visibility="{binding path=isselected, converter={staticresource booleantovisibility}}"/>                 </datatemplate>             </sdk:datagridtemplatecolumn.celltemplate>         </sdk:datagridtemplatecolumn>     </sdk:datagrid.columns> </sdk:datagrid> 

for design reasons, want button show when row contains selected. and, if possible, want show in different way when row being hovered over.

there seem more limitations silverlight , wpf had hoped. hope these things possible. thanks. :)

edit:

i not have, , not getting expression blend. thank you, all.

whenever want change visual appearance of in silverlight, have think in terms of visualstatemanager. change appearance of selected datagrid cell, you'll need avail wonders of vsm. editing datagridcolumn.cellstyle's "selected" state can change appearance of selected grid cell.

  1. in blend, drag , drop new datagrid on page.
  2. right click on datagrid , choose "add column --> add datagridtemplatecolumn"
  3. right click on datagridtemplatecolumn in "object , timeline" pane , go "edit column styles --> edit cellstyle --> edit copy"
  4. right click on "style" in "objects , timeline" pane , go "edit template --> edit current".
  5. now comes interesting part, how solve problem of disappearing button. if button thing you've got in celltemplate can hide whole contents of cell.
  6. select "selected" state "states" pane.
  7. set visibility of contentpresenter in cellstyle.template collapsed. (a nicer ux add 0.3seconds animation taking opacity 100% 0%).

essentially whole tutorial getting cellstyle.template datagridcolumn , adding animation selected state.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -