silverlight 4.0 - How to add child control to Grid in specific position in code? -
suppose define grid in xaml like:
<grid x:name="layoutroot" background="white"> <grid.rowdefinitions> <rowdefinition height="auto" /> <rowdefinition height="*"/> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition width="auto"/> <columndefinition width="*"/> </grid.columndefinitions> </grid>
then want add child control grid in column=0, row = 1 in code behind.
how implement it?
quite late response here go:
grid.setrow(yourcontrol, 1); grid.setcolumn(yourcontrol, 1); grid.setrow(othercontrol, 0); grid.setcolumn(othercontrol, 0);
the first parameter control you've added grid. second parameter column/row position want add to.
Comments
Post a Comment