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 ?
Hi,
The only way would be though using CellControlAttached and looking at e.Cell.Control.Content
However, thats going to have side effects like i mentioned before, b/c of recycling.
If you could provide more information on what you're trying to modify, we can probably help you find a better way to do what you need.
-SteveZ
Here's a link to msdn FindName method. It will explain the command in more depth than I could here.
http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.findname.aspx
Let me know if you have further questions.
So, it´s possible.
Can you send me a code sample?
Where you able to the use the link Steve supplied and use the conditional formatting?
It is possible to use FindName to find a control but if you are trying to change the settings bases on some value or for a specific row, you’ll want to use the conditional formatting.
If you have any further questions, please let me know.
Can I find these controls ? Yes or No ?