ok jenny was absolutely right, my above solution works, but it happens that some rows seem to dissapear ocasionaly,i think it's due loose of viewport or someth...anyway here's working example similar to what jenny was telling to do...it is done with filterRow, but the same way would work with groupByControl:
1.u need something where u will dynamicaly change filterrow visibility, it can be some property, or as i used property in a singleton class:
public class ConfigurationData : INotifyPropertyChanged
{
public static readonly ConfigurationData Singleton = new ConfigurationData();
private Visibility _filterRowVisibility = Visibility.Collapsed;
public Visibility FilterRowVisibility
{
get { return _filterRowVisibility; }
set
{
_filterRowVisibility = value;
this.RaisePropertyChanged("FilterRowVisibility");
}
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string name)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
#endregion
}
2. u have to configure filterRow to be by default visible for master table and all it's childs like this:
<xcdg:DataGridControl>
<!-- we will have Default headers and footer for all child, and also we will see by default FilterRow for all childs -->
<xcdg:DataGridControl.DefaultDetailConfiguration>
<xcdg:DefaultDetailConfiguration UseDefaultHeadersFooters="True">
<xcdg:DefaultDetailConfiguration.Headers>
<!-- we will have also filter row by default -->
<DataTemplate>
<xcdg:FilterRow />
</DataTemplate>
</xcdg:DefaultDetailConfiguration.Headers>
</xcdg:DefaultDetailConfiguration>
</xcdg:DataGridControl.DefaultDetailConfiguration>
<xcdg:DataGridControl.View>
<xcdg:TableView UseDefaultHeadersFooters="False" ColumnStretchMode="Last">
<xcdg:TableView.FixedHeaders>
<!-- we will have column headers by default -->
<DataTemplate>
<xcdg:ColumnManagerRow />
</DataTemplate>
<!-- we will have filter row by default -->
<DataTemplate>
<xcdg:FilterRow />
</DataTemplate>
</xcdg:TableView.FixedHeaders>
</xcdg:TableView>
</xcdg:DataGridControl.View>
</xcdg:DataGridControl>
3. define a style that would target filterrow and set it's visibility according to your property (in singleton in our case)
and in addition we have datatrigger that would hide filterrow always, in case there are no rows to filter
<!-- we have configered to have FilterRow for master table and also every child (with DataGridControl.DefaultDetailConfiguration)
now with this style we let FilterRow to be visible only when want to (FilterRowVisibility) and also there must be some data rows to filter -->
<Style TargetType="{x:Type xcdg:FilterRow}">
<Setter Property="MinHeight" Value="20"></Setter>
<!-- show FilterRow only when we want to -->
<Setter Property="Visibility" Value="{Binding Source={x:Static local:ConfigurationData.Singleton}, Path=FilterRowVisibility}"></Setter>
<!-- always hide FilterRow when there are no items -->
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(xcdg:DataGridControl.DataGridContext).Items.Count}"
Value="0">
<Setter
Property="Visibility"
Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>