Featured post
silverlight - generate Grid from template -
howdy, i've got question regarding phone 7... want generate couple of grids in stackpanel - since have same layout thought great idea use datatemplates ...
but found grid object has no "datatemplate" property , i'm kinda stuck ... template use following:
<datatemplate x:key="speise"> <grid> <textblock height="36" margin="8,43,104,0" textwrapping="wrap" text="textblock" verticalalignment="top"/> <textblock horizontalalignment="right" height="36" margin="0,44,8,0" textwrapping="wrap" text="textblock" verticalalignment="top" width="92"/> </grid> </datatemplate>
the way thought of creating objects is:
grid blubber = (grid)this.resources["speise"];
but not working ... think it's again short thing, have no clue of how google :(
on phone grid not support data templating it's purely intented container layout.
outside of phone, silverlight has datagrid class use way it's not available on wp7.
if want simple way of generating large grid @ generating in code using nested loops create rows , columns. without knowing precisely you're trying achieve it's hard advise further.
also, in sample datatemplate using grid hold 2 textblocks. seems overly complex. stackpanel (or else) not more appropriate?
- Get link
- X
- Other Apps
Comments
Post a Comment