Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I would like to add the number of columns and rows through binding . I have been looking for it but I only find how to bind the content or how to do this task programatically in the code behind.

I want to do it in the ColumnsDefinitions and RowDefinitions but I am starting to think that there is no possible way to do this.

I am trying to do things like next but I only get XAML pasing errors:

XML
<Grid  ShowGridLines="True"  x:Name="rootGrid" >
  <Style>
    <Setter Property="Grid.ColumnsDefinition" Value="{Binding Path=GridRow}" />
    <Setter Property="Grid.RowsDefinition" Value="{Binding Path=GridColumn}" />
  </Style>


is it possible? What would be the best way to do this?
Posted
Updated 15-Sep-14 22:57pm
v2

1 solution

http://msdn.microsoft.com/en-us/library/system.windows.controls.grid.columndefinitions(v=vs.110).aspx[^]

It's not a dependency property, therefore you cannot bind to it. You will have to do it in code. See link for an example.
 
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