Hi
I have question with hierarchical grid.
In hierarchical grid we are using the + / - for expand and collapse the grid.
I want to place a next to minus (-) sign image (Like folder open image) when that grid expanding mode.
and change the (next to + plus sign) image (Like folder close image) automatically when that grid collapsing.
you help is highly appreciated. thanks.
by
ramesh
i would also like to replace the expander image with my own image. The child records in this case ar individual people scheduled on a task and I want to replace + and - with a "people" icon. I do not have a solution but maybe if another person asks we will get a response.
Hello,
Responce, true.
To achieve this you have to create a style for the RecordSelector. You can see the base/default style in the DefaultStyles directory installed together with out products in the Infragistics folder. You have to retemplate the record selector to change + and - signs.
Hope this helps.
Alex.
I thought I would be able to restyle an exisiting object. Thanks for identifying the exact object RecordSelector and where I would find it. Sometimes this is half the battle.
This is what I love about WPF. I can take something that functions perfectly and tweak one portion that has nothing to do with the functionality like the image being displayed and I have a whole new control.
Thank you for your help.
I finally have time to look at this and I do not think it is the RecordSelector but the DataRecordPresentor - ExpansionIndicator I want to re-style. This appears to be to the left of the RecordSelector when there are child records for a datarecord.
I looked in the DataPresenterGeneric_Express.Xaml to see if I could find the default styles and hope this is the correct file. I see a <!-- Expansion Checkbox --> and <igWindows:ExpansionIndicator entry. I am having trouble understanding where I could replace the icons used for Expanded or Collapsed. Maybe my XAML is what it should be but I would think it would be easy to replace these two icons with a little help.
Thank You
Here is what I have created ( a custom Expansion Indicator ) with Blend. You can it as a base to create your own ( really a lot of xaml code, I apologize :) )
<Style TargetType="{x:Type igWindows:ExpansionIndicator}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igWindows:ExpansionIndicator}"> <ControlTemplate.Resources> <Storyboard x:Key="Storyboard2"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="plusHorizontal" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"> <SplineDoubleKeyFrame KeyTime="00:00:01" Value="44.04"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="plusVert" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"> <SplineDoubleKeyFrame KeyTime="00:00:01" Value="-44.846"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </ControlTemplate.Resources> <Grid Background="#00FFFFFF"> <Grid RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True" x:Name="grdExpansionIndicatorClosed" Margin="41.5,21.5,33.119,14.643"> <Grid.RowDefinitions> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition/> </Grid.ColumnDefinitions> <Border RenderTransformOrigin="0.5,0.5" x:Name="outerBorder" Background="{TemplateBinding BorderBrush}" CornerRadius="2,2,2,2"/> <Border RenderTransformOrigin="0.5,0.5" Margin="1,1,1,1" x:Name="innerFill" Width="Auto" Height="Auto" Background="{TemplateBinding Background}" CornerRadius="1.5,1.5,1.5,1.5"/> <Ellipse RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Stretch" Margin="2,4,2,4" x:Name="plusHorizontal" VerticalAlignment="Stretch" Width="Auto" Height="1" Fill="{TemplateBinding Foreground}"> <Ellipse.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="1" ScaleY="1"/> <SkewTransform AngleX="0" AngleY="0"/> <RotateTransform Angle="0"/> <TranslateTransform X="0" Y="0"/> </TransformGroup> </Ellipse.RenderTransform> </Ellipse> <Ellipse RenderTransformOrigin="0.5,0.5" Margin="4,2,4,2" x:Name="plusVert" Width="1" Height="Auto" Fill="{TemplateBinding Foreground}"> <Ellipse.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="1" ScaleY="1"/> <SkewTransform AngleX="0" AngleY="0"/> <RotateTransform Angle="0"/> <TranslateTransform X="0" Y="0"/> </TransformGroup> </Ellipse.RenderTransform> </Ellipse> </Grid> </Grid> <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.EnterActions> <BeginStoryboard Storyboard="{StaticResource Storyboard2}" x:Name="Storyboard2_BeginStoryboard"/> </MultiTrigger.EnterActions> <MultiTrigger.Conditions> <Condition Property="IsChecked" Value="True"/> </MultiTrigger.Conditions> </MultiTrigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
Hello David,
Thank you for your post. I have been looking into it and I have modified the sample that Alex uploaded in the forum thread you provided, so now it works as you want. If you group by the second field the expansion indicators will be different. Basically I used converters in the Images’ Source Properties to set a different picture depending on which Fields is grouped and whether it is grouped at all.
Hope this helps you.
Hi Alex, I know that this post (http://community.infragistics.com/forums/p/18938/81442.aspx#81442) was some time ago now, but it would be really useful if this example could be extended to show how the plus/minus images could be different depending on which field was grouped...so that I can do something like explorer where the icon displayed is different depending on the folder type that is being expanded.
Thanks,
David
Yes, the best way to do this is in the InitializeRecord event set
e.Record.IsExpanded = true;
Hi,
Hi Alex,
Is there any way which always keeps the expander as expanded by default.