tags:

views:

457

answers:

3

For example:

<Grid Name="TestGrid">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Name="TestColumnName" Width="*" />
    </Grid.ColumnDefinitions>
</Grid>

I would like to be able to access the column definition in code using the name 'TestColumnName'.

A: 

What are you using to develop your application. This works for me just fine in Visual Studio 2008 SP1.

JaredPar
Working fine, just forgot about the x:Name.
Duncan Edwards
+1  A: 

Use the x:Name property instead of Name :)

Arcturus
+1  A: 

Have you tried:

this.TestGrid.ColumnDefinitions.Where(c => c.Name == "TestColumnName").SingleOrDefault();
Razzie