Click here to Skip to main content
15,906,285 members
Please Sign up or sign in to vote.
3.40/5 (2 votes)
See more:
Hi Maingrid starts-----
it has some column definitions
<grid>---childgrid
it has some row definitions
Inside i want to change the second row control(textblock) to first row
childgrid ends
Maingrid Ends
Is there any way to do this?Any suggestions?
Posted

1 solution

HTML
<grid>
           <grid.columndefinitions>
               <columndefinition width="250" />
               <columndefinition width="*" />
               <columndefinition width="Auto" />
           </grid.columndefinitions>
           <grid>
               <grid.rowdefinitions>
                   <rowdefinition height="150" />
                   <rowdefinition height="*" />
                   <rowdefinition height="Auto" />
               </grid.rowdefinitions>
               <textblock x:name="tb" grid.row="0" text="Hello" height="50" xmlns:x="#unknown"></textblock>
               <textblock x:name="tb2" grid.row="2" text="Hello2" height="50" xmlns:x="#unknown"></textblock>
           </grid>
       </grid>
       <Button Content="change" Click="Button_Click"/>

C#
private void Button_Click(object sender, RoutedEventArgs e)
     {
        // string s = "Hello";
         Grid.SetRow(tb, 1);
     }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900