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
2395
Change visibility of column when grouped
posted

I have retemplated the GroupByRecordPresenter with no problem. I have custom text and buttons that show up.

What I would like to have happen is that items in a certain column are hidden when they are grouped.

This is the field I'm trying to change:

 <igDp:Field Name="Instrument" Label="{Resx ResxName=Gui.Resource,	 Key=GuiInstrument}"			 Width="*"> 
 <igDp:Field.Settings>
 <igDp:FieldSettings AllowHiding="Never" CellValuePresenterStyle="{StaticResource InstrumentVisible}"/>
 igDp:Field.Settings>  igDp:Field>  

This is the CellValuePresenterStyle I'm using:

 <Style TargetType="{x:Type igDp:CellValuePresenter}" BasedOn="{StaticResource {x:Type igDp:CellValuePresenter}}" x:Key="InstrumentVisible" x:Shared="False">
 <Style.Triggers>
 <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Record, Converter={StaticResource GroupedInstrumentConverter}}" Value="True">
 <Setter Property="Visibility" Value="Hidden"/>
 DataTrigger>  Style.Triggers>  Style> 

And this is the converter I'm using:

	public class GroupedInstrumentConverter : IValueConverter
	{
		public object Convert(object valueType targetTypeobject parameterSystem.Globalization.CultureInfo culture)
		{
			if (value is Record)
			{
				Record r = value as Record;				
				if (r.FieldLayout.Fields["StrategyString"].IsGroupBy)
					return true;
				else
					return false;
			}
			// value wasn't valid, return nothing
			return null;
		}
 
		public object ConvertBack(object valueType targetTypeobject parameterSystem.Globalization.CultureInfo culture)
		{
			// Not used, return nothing
			return null;
		}
	}

The code does go through the converter just fine, but the visibility of the cell is still Visible, when I want it to be Hidden. Any tips for what I'm doing wrong?

Parents Reply Children