I set the FlowDirection of datagrid but to no use. If FlowDirection of DataGrid is set, should it be automatically set to all underlying controls. Currently the GroupByRecord header is showing data incorrectly due to its incorrect FlowDirection. Any ideas how can I make it correct.
I did this in dataGrid_InitializeRecord but didn't work. Any ideas?
if
(e.Record is GroupByRecord)
{
Style style = new Style(typeof(HeaderLabelArea), Infragistics.Windows.Themes.DataPresenterGeneric.HeaderLabelArea);
Setter setter = new Setter();
setter.Property =
FrameworkElement.FlowDirectionProperty;
setter.Value =
CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft
?
FlowDirection.RightToLeft
:
FlowDirection.LeftToRight;
GroupByRecord gbr = e.Record as GroupByRecord;
Thanks,
Imad.
gbr.FieldLayout.Settings.HeaderLabelAreaStyle = style;
}
style.Setters.Add(setter);
Thank you for your response. I know that WPF renders controls this way and we need to set FlowDirection to resolve this. But I don't know which style should I work with to set FlowDirection. I tried this but didn't work:
if(e.Record is GroupByRecord){ Style style = new Style(typeof(HeaderLabelArea), Infragistics.Windows.Themes.DataPresenterGeneric.HeaderLabelArea); Setter setter = new Setter(); setter.Property = FrameworkElement.FlowDirectionProperty; setter.Value = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
GroupByRecord gbr = e.Record as GroupByRecord; gbr.FieldLayout.Settings.HeaderLabelAreaStyle = style;}
Your help would be highly appreciated.
Hello Imad,
I am just checking have you been able to resolve your issue? If you still need any assistance on the matter do not hesitate to ask.
I investigated this behavior and I came to the conclusion that this is not an issue in our control. This is caused by the way the WPF TextBlock, Label or the TextBox render strings like these. Try for example <Label FlowDirection="RightToLeft">Brazil (5 items)</Label> and you'll see the same behavior.
Hwoever you do can modify the text using GroupByDescription_Format_OneChild and GroupByDescription_Format_NotOneChild strings via our resource customizer and set a different format. For a further reference about this you can check the following reference form our documentation:
http://help.infragistics.com/NetAdvantage/WPF/2011.1/CLR4.0/?page=WPF_Assembly_Resource_Strings.html
If you need any additional assistance on this, please do not hesitate to ask.
Thank you for your reply.
It was the in my first post. Here it is agian.
Could you please provide me with a screenshot of the arrangement of the data in the GroupByRecord that you are expecting.
Thanks in advance.