Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
Find a control in a ItemTemplate of a column in
posted

I have this grid:

<igGrid:XamGrid x:Name="GridLotes" >
    <igGrid:XamGrid.Columns>
        <igGrid:TemplateColumn Key="Especificacao" Width="400" MinimumWidth="300" IsSortable="True">
            <igGrid:TemplateColumn.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="ESPECIFICAÇÃO" HorizontalAlignment="Left" />
                </DataTemplate>
            </igGrid:TemplateColumn.HeaderTemplate>
            <igGrid:TemplateColumn.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Especificacao}" x:Name="GridLotesEspecificacao" HorizontalAlignment="Left" TextWrapping="Wrap" />
                </DataTemplate>
            </igGrid:TemplateColumn.ItemTemplate>
        </igGrid:TemplateColumn>
        <igGrid:TemplateColumn Key="Preco" CellStyle="{StaticResource GridCellEdit}" Width="130" MinimumWidth="130">
            <igGrid:TemplateColumn.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="PREÇO" HorizontalAlignment="Left" />
                </DataTemplate>
            </igGrid:TemplateColumn.HeaderTemplate>
            <igGrid:TemplateColumn.ItemTemplate>
                <DataTemplate>
                    <igEditors:XamNumericEditor Mask="{}{double:9.4}" x:Name="GridLotesPreco" Background="Transparent" BorderThickness="0" LostFocus="GridPropostasCellPreco_LostFocus" GotFocus="GridPropostasCellPreco_GotFocus" Value="{Binding Preco, Mode=TwoWay}" Margin="0,0,0,0" />
                </DataTemplate>
            </igGrid:TemplateColumn.ItemTemplate>
        </igGrid:TemplateColumn>
        </igGrid:XamGrid.Columns>
</igGrid:XamGrid>

And I want to find these 2 controls "GridLotesPreco" and "GridLotesEspecificacao" to change his proprties in dynamically.

How can I find these controls ?

Parents
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    What kind of properties are you trying to change? 

    The recommended way of doing these types of things is generally through bindings. 

    The xamGrid virtualizes/recycles all cell controls, so you can't really change just one cells dynamically in code behind. Otherwise, when you do, it'll show up changed on another row when you scroll. 

    If you're just trying to modify styles based on value changing, you can take a look at our Conditional Formatting feature. 

    http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=xamGrid_Conditional_Formatting.html

    -SteveZ

Reply Children