Hi is there a way by which I can implement a functionality where I can Load child elements of Xam TreeGird on click of parent.
Any help will be appreciated.
Hello Kartik
Thank you for the update. You first binding for the template is close. In the textblock for the AncestorType you will want to set CellValuePresenter instead of the user control. Then of the binding path it would be Record.Cells[SeriousIncidents].Value. If that doesn’t work please attach a sample of what you have so I can do some debugging on this side to see how the behavior you want can be achieved.
Hi Mike,
Thanks for your help.
We had scenarios when we had to display multiple fields in single column, something like this
for this i had to do something like the following:<ig:Field Name="SeriousIncidents" Label="Serious Incidents" LabelTextWrapping="Wrap" Width="80"> <ig:Field.Settings> <ig:FieldSettings> <ig:FieldSettings.CellValuePresenterStyle> <Style TargetType="{x:Type ig:CellValuePresenter}" BasedOn="{StaticResource {x:Type ig:CellValuePresenter}}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <StackPanel Orientation="Horizontal"> <TextBlock x:Name="Center"> <TextBlock.Style> <Style TargetType="TextBlock" > <Setter Property="Text" Value="{Binding Path=Cells[SeriousIncidents].Value}"/> <Setter Property="Margin" Value="{StaticResource MarginSmallLT}"/> <Style.Triggers> <DataTrigger Binding="{Binding Path=Cells[SeriousIncidents].Value}" Value="0"> <Setter Property="Text" Value=" "/> </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> </TextBlock> <Path x:Name="Right" Width="20" Margin="{StaticResource MarginL}" Stretch="Uniform"> <Path.Style> <Style TargetType="Path"> <Setter Property="Data" Value="{StaticResource RightGeometry}"/> <Setter Property="Fill" Value="{StaticResource BrushYellow}"/> <Setter Property="Height" Value="15"/> <Style.Triggers> <DataTrigger Binding="{Binding Path=Cells[SeriousIncidents].Value}" Value="1"> <Setter Property="Data" Value="{StaticResource CrossGeometry}" /> <Setter Property="Fill" Value="{StaticResource BrushRed}"/> <Setter Property="Height" Value="10"/> </DataTrigger> </Style.Triggers> </Style> </Path.Style> </Path> </StackPanel> </ControlTemplate> </Setter.Value> </Setter> </Style> </ig:FieldSettings.CellValuePresenterStyle> </ig:FieldSettings> </ig:Field.Settings> </ig:Field>
It did help to achieve the desired output.
From your reply above I cam across TemplateField and DisplayTemplate
It seemed like a good option and tried implementing the same as:
<ig:TemplateField Name="SeriousIncidents" > <ig:TemplateField.DisplayTemplate> <DataTemplate> <StackPanel Orientation="Vertical">
here you can see i tried both ways but could'nt bind. <TextBlock Text="{Binding Path=SeriousIncidents, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}"/> <TextBlock Text="{Binding Path=SeriousIncidents}"/> </StackPanel> </DataTemplate> </ig:TemplateField.DisplayTemplate></ig:TemplateField>
Also Tried
<TextBlock Text="{Binding Path=DataContext.OfficeDetailsList.SeriousIncidents, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
OfficeDetailsList is my ItemSoure(ListOfRecords)Also tried the one which i used in CellValuePresenter example above i.e.Text="{Binding Path=Cells[SeriousIncidents].Value}None of this helped to bind the value.Your example on Template field usesValue="{igEditors:TemplateEditorValueBinding}" , I can't use the same since i have to bind multiple value like inside my column i can have three controls which bind to 3 different fields.I appreciate your efforts and patience, will appreciate any help in this matter.Thanks.
Hello Kartik,
What you are seeing is the expected behavior. You cannot setup multiple fields/columns that only exists in the datasource once. Instead, if you want like a blank column that you can fill in values you can use an unbound field:www.infragistics.com/.../xamdatapresenter-add-unbound-fields-to-a-datapresenter-control If you want to customize how a field displays you can have a template field:www.infragistics.com/.../xamdatagrid-configuring-template-field
Thanks for your constant help, another basic problem that we had been facing is we are not able to give same binding to two different fields
eg
<ig:TextField Name="Office" Label="Office" Width="300" LabelTextAlignment="Center" />
<ig:TextField Name="Office" Label="Place" Width="300" LabelTextAlignment="Center" />The above doesn't work and the control doesn't render.Also if we have to display some blank column, in case we are not yet sure about what is to be displayed in that column and we do something like this
<ig:TextField Label="Office" Width="300" />Then the above doesn't work eitherCan you please help in this matter
Thank you for the update. The styles are installed as a part of the product at:
C:\Program Files (x86)\Infragistics\<version>\WPF\DefaultStyles www.infragistics.com/.../designersguide-location-of-generic-xaml-file
You can also use this doc on styling points as a reference on what to look for:www.infragistics.com/.../designersguide-styling-points